-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
File upload doesn't work on webview #11230
Comments
Can you provide a sample app like a rnplay.org link that reproduces this? Especially if there is some error from the webview that would be helpful to know. |
I have made a small example here https://rnplay.org/apps/JFUPjw so if you press choose file nothing will happen. I am expecting a file selector from the local files. And the module/package I am using for my webview is this https://github.com/alinz/react-native-webview-bridge. |
Does this work if you just make a regular iOS app and use that WebView? It is not clear to me that regular web pages are supposed to get file-upload-request permissions inside mobile apps. |
Yes, this does work in iOS app. |
For Android; is it possible you need a permission to read files from the system? Or there might be a need for a native code to handle this. Reading http://stackoverflow.com/questions/24470932/html-file-upload-doesnt-show-gallery-on-android and https://code.google.com/p/android/issues/detail?id=62220 I'm not sure if the default WebView client supports this out of the box. |
@the-ant those might work but they don't have all the new onMessage functionality and are outdated |
@nhayfield At last, I decided to use the crosswalk webview |
In the end I used the code from this repo. Where I have created my own webview so also the onMessage functionality is there and the file upload. |
@the-ant yeah i been looking at crosswalk but its still not fully functional for what i need yet. might have to put in some Pull Requests on it |
Over the weekend I needed this functionality on Android for a deadline, so I reworked one of the above repos into a library that can be installed into an existing project using the usual process ( It still has the limitation of the original repo that it only works with image uploads from the gallery - but PRs to add other input handling are welcomed, and should be relatively simple, the codebase has been stripped down significantly. For anyone struggling with iOS, you only need to add the |
See my PR for this on Android: #12807 |
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally! If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution. |
Not sure this should be closed. There is a working PR to fix it, that just needs to be reviewed and merged. |
I'll comment on the PR as well, but my impression here is that WebView is one of those components that probably should be split out of core and provided as a separate package. |
bump |
Is this issue resolved? I'm still having the same problem. |
I meet the same issue too... |
I make a sample project hushicai/ReactNativeAndroidWebView, based on |
This is not fixed yet. |
@hramos Can you provide any further insight into why this should be a separate package? Your argument on the linked PR seems to be that it's because it doesn't impact Facebook's internal use cases, but doesn't it seem odd to require a package to add functionality to Android that exists on iOS? It's likely that any such package would quickly become outdated and unmaintained to add insult to injury. I would imagine that most people use React Native with the hopes of reducing device specific code and this separation seems to encourage device specific code. |
I'm also still having the same problem. Please reopen this issue |
I'm having the same problem too. Anyone solved the problem? |
Same problem.File upload is an basic operation. This should add to the feature. |
m2 ,Help! |
Is the problem solved?. It's very basic operation. |
the same issue too |
Still happen |
+1 |
2 similar comments
+1 |
+1 |
I have a PR that fixes this #12807 but it doesn't look like it's ever going to get merged because the facebook team would like webview moved out of the core repo. You can still use the code from the PR in a forked react-native if you need this functionality. |
When will React Native Team make this funcionality available in the core repo or make it work in a different module? We need to upload files through WebView!!!!!!!! It's a shame it's not working yet. I'm very disappointed, once I'm spending a lot of time trying to fix what you should've fixed more than a year ago. 👎 P.S: You should reopen this issue. |
Please be grateful @HosanaUFRRJ2014 |
any updates? |
I haven't got any solution from this conversation yet! Tried almost everything. |
Okay one solution finally worked for me :) Or else you will have to upgrade your RN version first (which turned out to be a tedious task for us) Hope this helps! |
+1 on this feature/bugfix |
+1 for this feature as this is very native feature which should be included. |
Description
When I am pressing a input file button inside the webview, nothing happens.
I am trying somehow to fix the core webview because I am using a module on top of this webview but also that one has the same problem.
Additional Information
The text was updated successfully, but these errors were encountered: