I am using the Web component to save pdf file from a website.
In screen1 (startup) I have set Defaultfilescope as shared. When I set responsefilename = download/Test.pdf in Screen1, it saves at /storage/emulated/0/download/Test.pdf. I am showing the saved file path in a label.
But the same code and components in screen 2 give me a saved file path to /storage/emulated/0/android/data/edu.mit....../download/Test.pdf.
I want the screen2 response to also save at /storage/emulated/0/download/Test.pdf (shared one).
Users can later find the files in the download folder easily. Why does the default path change from screen1 to screen2 even when Defaultpath in screen1 is set as shared?
Directory names are case sensitive, correct would be /Download/Test.pdf
What happens, if you set the default file scope to Legacy?
What happens, if you use a full path, i.e. /storage/emulated/0/Download/Test.pdf?
Taifun
It seems the path for responsefilename is preset. the input works as only a file name or an appended path to it..
I finally used this.. works for both screens. I don't know how..even when the default scope is set to app. it saves to the correct -> /storage/emulated/0/Download folder
I have to use three extensions just to download and open with activitystarter. While customwebview downloadhelper and filetools are great extensions , it's a lot for just download and view.
I'll revisit it. I did have a potential solution but I think there was a corner case in the companion that was causing it to fail. We may need a patch to the code generator as well as to the companion to make it work correctly.
Specifically, you could a sequence like open Project A Screen1 and then transition to Screen2, open project B Screen1 and then switch back to Project A and the scope setting would be the one from project B not project A.
Ok, this is probably getting unnecessarily complicated. We can work around the problem pretty easily by moving the file from the ASD to the Shared folder afterwards.