-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opening a local file href in webview #7955
Comments
Does it work in debug mode but not in release ? Could be related to #7924. |
It doesn't work in debug mode. I'm not sure what is considered "root" from the webview's perspective. The files I'm trying to access are in (when you |
Figured it out after reading @grokbot's comment in itinance/react-native-fs#49 - you have to use |
I don't fully understand the solution here, could you elaborate? I'm unable to load a pdf into a web view in android, its just blank, with no error messages. I've tried an |
is the location of the file on http:// or are you using react-native-fs? The reference above was using a file:// url retrieved from react-native-fs ... not sure what ramifications there are for WebViews |
The urls I've got are |
I have searched all over for an answer to this question. Have any of you solved this? To be clear if we were facing the same issues, I am rendering a web application through a web view. The loaded web page has a login form. Once the user logs in there is a download link which when clicked should download a .txt file to the user's phone. But when the user clicks the download link nothing happens. Does anyone have any information on how to solve this problem? I need the download link to download the file to the users phone. |
convert it to base64 and inject it in the webview... |
Thanks, we ended up doing it natively with Swift and Android. |
This might help: #505 (comment) |
Platform
RN 0.26
iOS and Android
Mac OSX
My application allows users to download documents to their phone's Documents/ folder using react-native-fs - but I'm unable to open these downloaded files. I have tried rendering
<a href="..."></a>
tags with the following formatsNothing happens when I press the link. I'm thinking maybe the path returned by
RNFS.DocumentDirectoryPath
is not correct, although when I paste this path into a browser (on my desktop running the simulator), I am able to get to the file.Edit: I am able to open the file using a Webview with a
source={{uri: ...}}
prop though. I suppose I could launch a new webview each time a user launches something which should be render-able. But this doesn't solve cases of files that need some type of native app.2nd Edit:
source={{uri:...}}
doesn't work for PDFs in android, but works in iOS.The text was updated successfully, but these errors were encountered: