No.
Then you shouldn't have provided these methods:
Not for non ASD actions, I am saying for ASD.
As I said, you must declare READ
& WRITE
permission in the Manifest (at least for API 7 - 18) also for ASD. So users must add a File
component and enable the READ + WRITE
permissions in the Designer.
Version 2 Updated
WHAT'S NEW
- Fixed file not downloading issue with some links.
- Renamed StopDownload to CancelDownload.
- Removed GetDownloadSpeed block due to internal issue.
- Added new method FileSize to get file size from file path.
Hello, I am testing your extension and I have a problem that seems to be url dependent. I tested using your test app and also with simper example written by myself and the results are the same.
I uploaded the same files in both directories in the server, you may test with a normal browser, I did not put any read restrictions on those directories.
Do you know what means the error? And do you may explain me the different behaviour?
Thanks,
Massimo
Ok, I found the solution but in my opinion there is a problem. If my file is https://levocidiastarte.com/tmp/win.ico I have to input to ASD.DownloadFile url as https://levocidiastarte.com and as fileName tmp/win.ico and then it works. The problem is that DownloadFile saves the file in ASD/tmp (for ASD I mean the folder of the app ASD. I think that givin one more input (may be path?) could be better because the user can select the directory where download the file.
Hi,
As this extension is to download files in ASD, download file path is by default set to ASD. You can change the download location within the ASD in other folders but not outside the ASD.
If you want to save that file in other locations either you can copy the file from ASD to your preferred location after it is downloaded or use other download extension/component that allows you to set download path.
I did not explain well what I mean. If I download win.ico from https://levocidiastarte.com, so the complete file name is https://levocidiastarte.com/win.ico then the extension will download it in /win.ico
Instead if I download https://levocidiastarte/tmp/win.ico the extension will donwload it in /tmp/win.ico I would prefer that win.ico is downloaded always in /win.ico or, better, have the possibility to define a subfloder of where download win.ico
(P.S. there are missing dots or commas at the end of some phrase to do not generate misunderstandings).
Okay now I understand.
You have set wrong url and path. Try this:
Url: https://levocidiastarte/tmp/win.ico
Path: win.ico
In url set full download link of your file and path will be win.ico (filename.extension).
If you want to set a custom folder then before file name set folder name
My folder/win.ico
Hope this helps.
OK, it works it is a solution.
Just to understand: why if I put:
url: https://levocidiastarte/tmp
and
path: win.ico
it returns the error: Failed to download the file. Reason: placeholder
?
Because the url you set is not a file url, so it will gives error.
To download a file the url should be set to actual file url.
But also if I put:
url: https://levocidiastarte.com
and
path: tmp/win.ico
it works... also if url is not a file url...
I'm not sure how this works for you, but ideal approach should be as i said earlier url: file url and path: file name.file extension
Updated Version 3
if i close screen before download complete then what happen?
download complete or not?
As far as the app is still running in background (not background task) or in recent apps, downloading will continue. If you remove the app from recent apps , downloading will stop.
If this is a very large download (i.e. a 4k video with 40+GB, for example), then the download in the background will stop after a few minutes as Doze mode throttles down / terminates all possible processes. In this case you would have to start a Foregroud service to prevent Doze.
We could use Itoo in that case with this extension.
Updated Version 4
Added properties to set notification title and description, if system download notification is being set to visible.
Added property to set Custom Download Path to set custom path other than ASD, that means now this extension is not limited to ASD only, it can download files in specified path.
Added a new function: FilesListFromAssets to get list of files from app assets directory.
Please provide App Inventor screenshot of the blocks so we can see, that the extension is also working in App Inventor
Which Android versions did you use to test the extension?
Are you aware, that on newer devices you are not allowed anymore to write files to arbitrary directories, for example /My Files
? See also Some basics on Android storage system
Taifun