Fetch File by File

Hello every body,

I have an app that is just to fetch file by file from google drive.
I just need a help to know how to create a folder to save files with path : file:///storage/emulated/0/Android/data/packageName/files. So that it can be accepted in App Console to update my App.file_by_file.aia (25.7 KB)

Have you tried writing your directory name after the forward slash here:

image

e.g.
.createDirectory: call getASD / MyFiles

Yes Tim, I have tried to make the path. But Unfortunately it is the same result.
Please see my blocks blocks

Which extension / component you are using to donwload file?

If you are using web component it downloads file to ASD, or you can set response file name.

Actually, I use web component. But it doesn't download file to ASD. It download to different path.

It is not completely obvious, but from your blocks it appears that you are trying to download the content of the files stored on Google Drive (as evidenced by the url you are using), and store that content in the TinyDB, you do not have any GotFile event blocks. Is this correct? Is this what you are trying to do?

I could be wrong. Why are you trying to convert your "downloaded" files from base64? There is no need to do this ?

Yes, this is exactly what I want and I tried to create the directory by using base64.

That doesn't make any sense...

Explain what you want to do.

file_by_file.aia (25.7 KB)
Here is .aia which is downloading files to /Download/GDFiles/ I don't want to download files to this path.
So, I want to download them by using ASD. I hope you understand me now. Thank you Tim

Just throwing your aia project at us will not help.

I do not understand. You either want to download physical files or you want to download their content and save that to a tinyDB? Please explain.

I want to download more than one hundred .csv files e.g like this 1
from google drive after click a fetch button but I am affraid that there is wifi disconnected so that after connect to wifi again it will continue from where it was stopped

To be easy for me let's say when the wifi disconnected it will restart downloading again after click fetch button again instead of continue downloading from where it was stopped.

OK, but do you want to download physical files, or just download the content and store that content in tinyDB ?

Also, in your last topic, you did not want to download the contents of the google sheet with the filenames and fileIDs, instead preferring to have a csv file with this data in the assets, because of concerns with wifi/data connection. Which method do you intend to use / or both ?

I have made up an aia project that uses a csv file in the assets to provide the file list, and to then download the files - file by file. A folder called MyFiles is created in the ASD and the files are downloaded there. I used @Juan_Antonio's network extension to test for wifi before allowing the download of files. The blocks should handle a break in wifi, and continue to download files where they left off (it is possible may have a partial file because of a break in wifi, i do not know what Android does in these situations...)

CSVfromGDReadAndDownload.aia (14.2 KB)

Over the years we must have done this same exercise a dozen times, let us hope this is the last...:wink:

Thank you Tim for helping me a dozen times over the years. Good lucks... :innocent:

Can we lists gdrive folder and then select file to download ?

You need to set up a google sheet so that you can run an apps script to capture and store filenames and file IDs from specific folders, then you can select as you wish.

See here:

and then here

it seems too complicated for me

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.