Hey I'm struggling to get a tiff image downloaded from an FTP site to display in a WebView. After entering in the url in the format imageView.loadUrl("ftp://username:password#ftpsite/path");
(and the url is able to successfully download an image in ie or chrome)
I get an error message saying net::ERROR_UNKNOWN_URL_SCHEME. Does FTP not work in WebView? What else could the problem be?
(I later tried just downloading from the ftp site to the app but the image is .tiff and that opened up a whole new can of worms so I'm back to trying to use WebView instead of ImageView)
Edit: updated url with the path I actually use, I sloppily typed it in before :/
Related
I have an App in which I want to display PDF files in a webview. I have managed to get the code up and running, but the problem is when I try to run my App, it displays this "no preview available" to me.
I am thinking the problem is with my PDF URL from firebase. Because another PDF URL loads just fine.
Does anyone know what's wrong? And how can I fix this.
Ok I just tried it myself, the problem is that with firebase the PDF gets downloaded rather than display by webview. Try storeing the PDF in the drive an use its url for webview. Hope it works.
I'm using Xamarin Forms with Android, I need to open a PDF from an URL in my WebView. For some reason, sometime the the Webview is blank. I've searched a lot on Internet and I found some solution that give me the same result, sometime the PDF in the PDF is showed without problem, sometime is a blank page. I'm using "https://drive.google.com/viewerng/viewer?embedded=true&url=" with no results, I'm using this solution ( https://acaliaro.wordpress.com/2017/11/30/open-a-pdf-inside-a-webview-in-xamarin-forms-android/ ) that describe exactly my problem but WebView still show me a blank page sometime.
So, why is so hard to open a PDF Url on Android in a WebView? There is some solution to fix this problem? I don't know what can i else do.
Android WebView not support .pdf file from website, infact, if you try to copy an url with .pdf extension in chrome browser, this will download the file and open in an app. So there is no way to show a PDF in an App in a simple way. But there are two solution:
On Google there are a lot solutions that tells you to download the PDF and show in an webview, but in my case I can't download a PDF and show.
You can write an .html page in your Server that can "wrap" the PDF sended with an URL in GET mode and show it in an .html page without problem ( using jsPDF is an example ) or by using this prefix ( http://drive.google.com/viewerng/viewer?embedded=true&url= ) but sometime i give a blank page, so i write my own pdf viewer. In this link ( https://acaliaro.wordpress.com/2017/11/30/open-a-pdf-inside-a-webview-in-xamarin-forms-android/ ) you can find another solution, but for some reason, it still doesn't works. Maybe because I'm on Android 5.0 device.
I am using google drive to open various pdf and .doc files through my android app in a webview all seems ok but when i try to open an image of png or jpg i get an error.
"Whoops there was a problem displaying this image."
here is a test you can run in a browser to get the same error
image link
is it even possible to open images like this or should i be using an installed app?
I have a PhoneGap app for Android which I am trying to run in the Android emulator. The app has a simple html page which has a button. On click, the button calls a RESTful webservice using javascript XMLHttpRequest and the service returns back base 64 encoded data for a pdf. Then from the javascript function, I try to load the pdf data in my html page in the app as below
document.location.href = 'data:application/pdf;base64,' + pdfData.childNodes[0].data;
But this does nothing. The data is returned correctly and I checked the logs for it. But the pdf is not displayed at all. Any idea what is causing the issue?
In Android you not show pdf file in Webview. Have some solution to view pdf file in Android:
Use google pdf view
mWebView.loadUrl("https://docs.google.com/gview?embedded=true&url="+LinkTo_pdfFile);
Download pdf file and view by pdf reader in device. Check this
(My solution) I parse pdf file to image and store onto server and i only download and view image directly.(It have bit complex, but you can view pdf, docx, xls,..). Example here
When I visit my site from android (Froyo 2.2) browser and when i click to view image it start to automatically download that image instead of displaying the image in browser.
How can I display my images in browser instead of downloading them?
My browser is set up to load images in settings and I can view pictures on other sites without downloading them to my sd card or phone memory.
Thanks!
If your site when you click on the image send you directly to the image file then that's probably why the android browser tries to download it since he understands it as file. Maybe you should try to display the image in an html file.
For example when you click on an image, it could direct you to an html file with a parameter of the image name. Then inside that html you can have a javascript code that will load and display that image.