Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
We are working on windows mobile App. In mobile App, we have majority of functionality in webview component. We have a functionality for uploading image.

We have used HTML File tag for browse and upload image. When clicking on Browse option, we have managed to open the gallery. however, we are unable to upload the image and transfer the selected file into webview.

Does any one knows any workaround or faced similar kind of problem and found any alternatives?

Any suggestions in this will be really helpful.

Thank you

What I have tried:

We have tried by creating a simple html form with upload file tag. But that too doesn't work.
Posted
Updated 27-Feb-17 2:36am
v2

1 solution

Windows Phone's WebView perhaps does not file upload itself — see here, File uploading not possible from inside a Webview?[^]. Maybe Microsoft did not want users to upload the content, using WebView.

An alternate to this would be to use your own HttpClient object and then upload the file to that Uri by encoding it to multipart form data. POST request can be issued from there, and knowing the URL or Uri you can easily upload the files, if you handle the JavaScript code such as btn.onclick = uploadFile(); etc. It comes to me with a shock, that Microsoft locked out file uploads. :laugh:

HttpClient class - UWP app developer | Microsoft Docs[^]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900