Not one of standard directories

I`m trying to download some pdf files from google drive, but I tried all the possibles dir (toDirectory) but I kept getting the same message:Not one of standard directories…
111teste

This extension works for Android <10.

Additionally you need the AskForPermission: WriteExternalStorage block.

To download files you can use other extensions, for example this one:

3 Likes

grafik

/data/data/ is the root dir of the internal storage of the device.

You have to download files to the external storage.
See also here:

2 Likes

OK that extension worked for me, but now I have a different problem...... I was using the view URL to display the pdf on a web component..... but now in the extension I need the Download URL.... how can I manipulate the URL text?
for example:
I have this one on StartValue https://drive.google.com/file/d/1i1YO1FziI0hhEbxuaMiwEA1BTpMlBCwN/view

and I need to have this one to be able to download the file
https://drive.google.com/u/0/uc?id=1i1YO1FziI0hhEbxuaMiwEA1BTpMlBCwN&export=download

Use the replace text block to replace:

file/d/ with u/0/uc?
and then
/view with &export=download

1 Like

thank you !! It worked..

one more question... Do you have other extension to download the file and storage on my phone ? because for my app I need to have the PDF file on my phone to open anytime I want .... and with this ASD download Im not allowed to access the files because they are not visible.

What is your version of Android?

If you want the user to see the downloaded file on the device (on devices with Android 11+) you have to copy / move it from the ASD to one of the Shared folders (like /Download or /Documents).

2 Likes

Thank you I´ll try it!!

My Android version is 11

can u plz give the link to download the file extension? I downloaded one puravidaapp but it does not have the MoveFile block

Of course, the TaifunFile ext. has two move blocks, but you don't need it. I used the File component.

I used only this extension from @TIMAI2:

2 Likes

help me I tried to do like you but Im getting this error msg ...... sorry Im very beginner on it

image
image

when exactly does that error occur?
this will help to find the corresponding malicious blocks...

Taifun

1 Like

You are missing a forward slash / before storage for your pathToPdf and you have an extra forward slash / after the 0, should be

/storage/emulated/0
/Documents/myFile.pdf
2 Likes

I still getting the same error msg. I dont have an SD card on my cell phone do you think its the problem?

Android creates a virtual SD card, it is not the problem.

Go back to your blocks, and test each part of your workflow to find out where it breaks. You have been provided with a working set of blocks by @Anke.

Does your if/else conditional test work ?
Is the file downloaded ?
What is the path to the downloaded file ?
What is the path after you move the file ?
Does the pdf display ?

2 Likes

Set toScope → FileScope to Shared

This should work as long as the file has not already been created by another app (e.g. with Companion):

grafik

However, if this is the case, the file name must be different (e.g. myFile1.pdf). Create the APK and test it (without testing with Companion beforehand).

2 Likes

Try this app (APK):

2 Likes