FileTools : Some tools to work with files

As @Taifun said, if a non-media file was created in one of the shared folders, this file can no longer be accessed after uninstalling and reinstalling the app, because the app “has no reminder” that this file was created by the app. In this respect, I have been solving the problem since targetSdk = 30 by always appending a timestamp to the file name.

(Another way is of course to save it in the ASD.)

2 Likes

This block does not return the exact path of the file, it returns /storage/emulated/0/file.pdf when it is actually in /storage/emulated/0/download/file.pdf, how can I make it return the real path? ?
component_method

It will return complete file name/path instead of correct file name/path. The method just prefixes external storage path and does not check if file really exists there or not.

hello, i have a problem with the extension. I don’t get a list, I have permission to save
blocks(18)

Remove file://

1 Like

If you trying it in Android 11 then you need to grant MANAGE_EXTERNAL_STORAGE permission from Settings.

If not granted then you will only get list of folders and files created by app itself.

2 Likes

… and media files (to be precise).

1 Like

i use your custom webview extension for download purpose and it work
but it save in /storage/emulated/0/Android/data/com.myprojectname/files/TempDownload/+label1 text
so i want to show the download files in custom folder like storage/emulated/0/Wallpapers
i use this filetools to move but not working
please reply i am waiting

whats ur android version? and show ur blocks

Android 11
When download complete
Move file from (location)
To (location)

You can no longer write / save in any folder of the external storage on Android 11. You have to copy / move it (a non-media file) to one of the Shared folders (/Download or /Documents).

See also here:

2 Likes

I have a request. Please do it please. Add copy & replace feature in this entension. I badly need this please. Thanks you so much​:white_heart:

Are you sure that should be implemented in Extension ?
I don’t think so.

Yes, some of our app need the file with same name. So, after we download we need to copy & replace old file. It will help us a lot. You are a big coder. Can you help us by adding this features? I am a big fan of yours. Please give us a update with this option​:white_heart:

Why not use Copy or Move method?

I need to move a folder & replace all file inside with same name. But not others file inside. Can u suggest me how to do it. Your extension is not replacing folder files

Copy block can over write the files and Move block can replace the files

your file name and destination path file name should be same to overwrite or replace file

Can you give me a Demo app with the coding you said

On android 11 copy txt file not working
Copy file from android/data/packagename/test.txt to storage/emulated/0/test.txt
Please reply