Android Question Copy file from File.DirInternal to "application/octet-stream"

fernando.oliboni

Active Member
Licensed User
Longtime User
Hello, I am using these functions to copy a file from the "File.DirInternal" folder to the "application / octet-stream" folder

https://www.b4x.com/android/forum/threads/saveas-let-the-user-select-a-target-folder.129897/:

The problem is that the name of my file is always the same, for example: tutu.txt, only changes the content of the file and when I run it a second time it creates a tutu.txt (1) and I want it to replace the previous one and don't create another one.

Can someone help me?
 

Mahares

Expert
Licensed User
Longtime User
The problem is that the name of my file is always the same, for example: tutu.txt, only changes the content of the file and when I run it a second time it creates a tutu.txt (1) and I want it to replace the previous one and don't create another one.
You can change the file name before you save it by typing a new name in the prompt box. If there is an existing file with the same name, it saves it to a new file by adding a (1) to the file name. For instance, if the file is votes.db and you try to save it again, the new file is votes(1).db. It keeps incrementing file names.
I want it to replace the previous one and don't create another one.
If you want to replace an existing file name, you need to browse the folder where the file was saved the first time and click on that file name. Then click 'Save'. The screen will prompt you with a message box asking you: Overwrite votes.db. Click Yes to overwrite it.
 
Last edited:
Upvote 0
Top