I'm using CustomWebView to run microPython's WebREPL because using it in all normal android browsers annoyingly zooms in to full every time you tap on the monitor, but that's the only way to send messages. So through a lot of trial and error I figured out CustomWebView with UseWideViewPort set to false is the only way I could both prevent this as well as send and receive files like a normal browser does. It was a little tricky to get files to send but it works fine. Receive however has been a massive headache and I just can't figure it out. Using the traditional way I get this error...
With a ridiculous amount of work I figured out how to get past this and get a bunch of debug to try to solve it. But I can't seem to get anywhere further with actually downloading this file.
As the file is updating, the web page is incrementing how many bytes it has received, and I'm getting a progress notification each time but it's always 0. Then it says it's completed and then failed. When I look at the file android tried to save I get this
I can't get it to work regardless of what I do but this is the closest I've gotten.
The web page I'm visiting is actually running on a microcontroller but everything works fine in a real browser and all the source code can be found at
And finally, here are my blocks
You cannot download a blob url in Android.
It is possible to convert the blob to a base64string and download that - using javascript, then converting it back to a binary file in the app.
Is there a way to do that with the download helper block? or how would I go about downloading that file?
No do not believe so. You have to do it upstream where the blob is created.
Explain.
Image Upload and Title this is the link
i use on the webviewer but the choose file wasnt able to be click do you have any idea to fix it? im new and still learning on mit app
Are you using CustomWebView or Webviewer?
webviewer
You can't access the file system in WebViewer. You do that with CustomWebViewer (where you are now) and it's done like this
Take note of FileUploadNeeded and AfterActivity. In your case I believe ActivityStarter's DataType would be 'images/' instead of 'text/'
Well, you can, but you have to use a different extension.....
Ok, yeah I guess my phrasing was technically incorrect. But anyway, as for getting a blob... I've been trying for 2 hours to find any way to get the data. I'd be fine with sending it to a label or something but I can't find any way to get the actual data. I can see the data is there, but I cant access it. I have tried every function on CustomWebView and KIO4_base64.
Unfortunately it is not possible download content from blob url directly.
But if has base64 data then please post that here. We can do something in that case only.
what extension can i use?? so hard to find it
In the above screenshots (post 377) I can see the the page incrementing the "Got boot.py, X bytes" and each time it does I get a new OnDownloadNeeded; so I know the data is going somewhere that CustomWebView is picking up, but I don't know how to see it. The web page source can be seen in the same post I made but I'm way better at working with microcontrollers than I am Java or HTML. Everything works in all mobile browsers but they all zoom in as far as possible every time a new command is sent and you have to zoom back out to read the response or send another. This is incredibly annoying and painful to use. That's the whole reason I'm trying to use CustomWebView. Everything else works but I want to be able to get the file or at least read it in a label and it's proving impossible for me.
can you show the example of the code? im kinda new to mit
I don't know what that means though or how to do it. I know c++ and python very well but this java and html stuff I just don't know very well. I get app inventor and the concept behind how this all works but I have no clue as to how I would get this data upstream. I don't even know what upstream means. I know I can process the data once I get it, but I don't know how to even get it. I just need the data inside that file when I click "Get File" on the web page. I don't care is it comes formatted as base64 and I don't need it to save or anything. I know it's going somewhere and upstream keeps getting mentioned, but how do I get upstream data?








