I want the user to be able to
I have all of this working fine with B4i using the code from https://www.b4x.com/android/forum/threads/b4x-texteditor-save-and-load-external-files.132731/ and multipart post. However, I have run into problems with B4A.
I have modified (slightly) the code from this tutorial to demonstrate the first part problem I am having:
I can select a file, however, I cannot then display it in a webview nor can I upload it using multipart post. Strangely, the ReadString function works fine.
I am using LoadUrl on the Webview to display the PDF.
Page Finished show that the webview thinks it has loaded the file.
The commented out line just gives a file not found error.
Any ideas what I am doing wrong?
FYI I am testing on a Samsung Galaxy Tab A
- select a PDF file from their local storage,
- display a preview of the PDF file
- and then upload the file to a remote server.
I have all of this working fine with B4i using the code from https://www.b4x.com/android/forum/threads/b4x-texteditor-save-and-load-external-files.132731/ and multipart post. However, I have run into problems with B4A.
I have modified (slightly) the code from this tutorial to demonstrate the first part problem I am having:
I can select a file, however, I cannot then display it in a webview nor can I upload it using multipart post. Strangely, the ReadString function works fine.
I am using LoadUrl on the Webview to display the PDF.
B4X:
WebView1.loadurl(xui.FileUri(Result.dir,Result.filename))
' WebView1.loadurl(File.combine(Result.dir,Result.filename))
Page Finished show that the webview thinks it has loaded the file.
B4X:
private Sub webview1_PageFinished (Url As String)
toast.show($"Finished loading ${Url}"$)
Log($"Finished loading ${Url}"$)
End Sub
Finished loading file://contentdir/content%3A%2F%2Fcom.android.providers.downloads.documents%2Fdocument%2F3197
Any ideas what I am doing wrong?
FYI I am testing on a Samsung Galaxy Tab A