Hi,
I want to download a file in my ASD to replace the one (same name, same usage for the app) already there.
I use the Anke extension downloadtoASD which works great, thanks !
I tried at first the simple way by just the download block.
Unfortunately, the system saw that a file with the same name exist and renames the new file with a -1, which means the app keeps using the bad one.
So I decided to check if the file existed first, and delete it, and then download the new file:
But : it doesn't work. The new file still gets renamed.
I suspect it's a workflow problem : the app doesn't have the time to complete the deletion of the first file before downloading the new one.
If that's the problem, what can I do ? there is no When file deleted block, as far as I know. I could start a timer and wait for a second or so but that means artificially slowing the app.
Or is there a solution to force the downloading to overwrite any existing file ?
I don't understand : Do you mean that the "Set Label Text to" block is enough to slow the flow for 500ms and allow for the download block to launch late enough ?
My blocks should make it clearer. So now just try these blocks and you will see that it works and that no duplicate csv file will be created (downloaded).
It works, thanks a lot !
If I may : the set file scope to block : can I put it just once if I have several files to download or is it necessary everytime I delete then download the new file ?
First we need to clarify why the files should be downloaded again. Does something change in these files? If not, it is sufficient to query whether the file(s) have already been downloaded and, only if this has not yet happened, to download them.
It is an export / import data feature in the app. The idea is to allow the user to export data to another phone for example. So yes, if he decides to do so, he will replace the data existing in the receiving phone with the data coming from the sending phones.
Due to storage restriction with android11 I understand the only way to do this is to download directly the data from the internet to the ASD with the app, the user can't pick a downloaded file in the download directory (which is VERY unfortunate in fact, because to guide the user to his file's exact url is tricky). But I don't know how to do it otherwise.
The files are light .csv ones. The simplest way to do so would be for the sending user to send the files by mail (that I'm able to simply do so with a share bloc), and for the receiving user to click on the attached file in his mailbox, which will put the files in the download folder. And then, in the app, to select the files in the download folder and import them. But I understand that the download folder isn't accessible by the app for .csv files ?