Remote s3 Pdf file not opening in webview. - iphone

Pdf file Uploaded to amazon s3 bucket is not visible when open on UIWebView. When tried to open it on Browser the file gets downloaded.

While uploading the pdf file on S3 bucket, specify the file type to PDF. And then the resulting url will open the pdf on both browser and UIWebView

Related

Why is the raw url of pdf file in github can't be open with browser directly instead of download

I tried pdf, txt and png file url, only pdf url can't be open with browser if click the url, but trigger download.
I google this but only got how to fix, like instead with google doc or use pdf.js, or other html code.
What is the reason? the website ? Forgive me that i have no idea of website architecture.
When you get a file from a website, it has a content type sent along with it. Depending on the content type, the browser may choose to display it. For example, content type "application/pdf" might be shown in a browser, but "application/octet-stream" will be downloaded.
The raw URL on GitHub has content type "application/octet-stream" (a binary file) so that it will be downloaded.
The only way around this, since you can't change GitHub's code that sets the content type, is to get the data from JavaScript and parse it there -- by using pdf.js or something similar.

Uploading Video to video Library using SharePoint2013 Rest APIs

I am using SharePoint RestAPIs to upload video to Video Library using the following urls and the video is uploaded successfully:
1._api/web/lists/getbytitle('Video Library')/rootfolder/Files/add(url='a.mp4')
2._api/web/GetFolderByServerRelativeUrl('/Video Library')/Files/add(url='a.mp4')
The issue is that the AJAX calling are return in the error method(file not found) not in the success method and I want to use the file url after uploading
Note the following:
1.when you upload a video to video library SharePoint create a folder with the name of the uploaded video file name and put the video file inside it.
2.If you already uploaded a file with the same name SharePoint create the folder with random name and put the video inside it.

filepicker.io - on .pick / pickAndStore use generated thumbnail

When the file picker is opened either using .pick or .pickAndStore, and an image is selected, a thumbnail of the original image is shown on the side.
I want to reuse that thumbnail, preferably from the already locally stored version. How can I access it e.g., with the filepicker API or other javascript library?
The thumbnail you see during uploading is generated by FilePicker javascript as a data URI (eg, src="data:image/jpeg;base64,...") it never really exists.
Once the file is uploaded you can use the image conversion rest API:
https://developers.inkfilepicker.com/docs/web/#inkblob-images

How to READ/PARSE the PDF contents loaded in an UIWEBVIEW

Assume the situation, i have an UIWebView and signed in into my gmail account, i have received an e-mail with an attached pdf file. Now am clicking on the attachment link the webview will open the pdf file there itself.
At this time if am trying to read the html contents it returns NULL.
Please help me by giving an idea. Now how could i read/parse that pdf content already loaded in webview and store the data into NSString.
if you have the URL for the PDF file then directly load the URL in the WebView otherwise you have to use the NSURLRequest to download the file and then load the file from the local directory of the application. I shall be glad to provide you with the code of loading the PDF file from the local directory however I suggest you to google it.

Open pdf file from the server in GWT

I want to open a pdf file from a button of my GWT application. Actually to access that file I've to query the server that returns the file encoded in base64 from a JSON request.
It's possible to open that file then?
To show a pdf "file" (it's not a file, but a byte stream in http reply) you need to rely on browsers own capability to render pdf data. To do this you must either open a URL in a new window or in in an iframe. The second is probably a better option when using GWT. Docs of the GWT Frame.
// url of the pdf (must have application/pdf content-type)
Frame frame = new Frame("url");
// add the frame wherever you want
RootPanel.get().add(frame);
In order for the browser to correctly display pdf page (by invoking the pdf plugin), the url that serves the pdf data must have a header that says Content-Type: application/pdf. Check that your response has this header.