Taifun
July 23, 2025, 2:18pm
21
Ad 1) remove the multipart header, it gets overwritten by your 2nd definition of the Content-Type and therefore works correctly
Ad 2) remove the header completely, see @TIMAI2 's example
Ad 3) your image is in shared storage and NOT in ASD... use the correct path to copy it
Taifun
1 Like
Taifun
July 23, 2025, 2:23pm
22
The file extension does not care about any scope
It needs a correct absolute path
From
file:///storage/emulated/0/Pictures/Telegram/IMG_20250715232624_409.jpg
To
file:///storage/emulated/0/Download/dog.jpg
Also make sure, dog.jpg does not already exist in that directory before copying
Taifun
1 Like
lladam
July 23, 2025, 3:10pm
23
Thank you.
its true need to remove the header, I tested with any type of header or without header don't have
any Influence;
I used the block below to do copy failed, anything wrong?
I have tested to make copy with TaifunFile1.CopyAsync inside APP works well. any way to copy files out side APP?
TIMAI2
July 23, 2025, 3:18pm
24
Use a decent file manager, like Total Commander. Should just work on Android 5.x. If not, supplement it with Googles Files
.
1 Like
Taifun
July 23, 2025, 3:40pm
25
lladam:
anything wrong?
Yes, just use the path directly
The correct question would be: "Is there any way to copy a file programmatically outside of scope App" to not confuse others
Yes, see my answer above
Taifun
1 Like
Anke
July 23, 2025, 3:44pm
26
lladam:
The File component uses a relative path (not an absolute path):
/Pictures/Telegram/...jpg
1 Like
Anke
July 23, 2025, 3:48pm
27
Yes, but your TaifunFile
extension should also work with a full path.
1 Like
TIMAI2
July 23, 2025, 3:52pm
28
Again with Android 6, copy a file from the Download directory to the ASD, using the File component:
1 Like
Anke
July 23, 2025, 3:56pm
29
Yes, but you need (must request) READ
permission on Android < 11.
2 Likes
lladam
July 23, 2025, 7:45pm
30
Thanks.
do you mean this way? tested not copy:
lladam
July 23, 2025, 7:46pm
32
thanks.
I'll change phone
TIMAI2
July 23, 2025, 7:55pm
33
lladam:
I'll change phone
You should see more or less the same behaviour with 5.x as I do with 6.
Taifun
July 23, 2025, 8:08pm
35
From the documentation App Inventor Extensions: File | Pura Vida Apps
Copy file (asynchronously).
Use this method to copy large files. The copy process is finished after the Copied event fires. Prefix the filename with / (i.e. relative path) to copy a file on the SD card. For instance /myFile.txt will copy the file /mnt/sdcard/myFile.txt. To copy assets packaged with an application (also works for the Companion) start the fromFilename with // (two slashes). However you can't copy files to the assets. If a fileName starts with file:/// you can specify a complete path to the file.
Example 1 (relative parh)
From
/Pictures/Telegram/IMG_20250715232624_409.jpg
To
/Download/dog.jpg
Example 2 ( complete path)
From
file:///storage/emulated/0/Pictures/Telegram/IMG_20250715232624_409.jpg
To
file:///storage/emulated/0/Download/dog.jpg
Taifun
1 Like
lladam
July 24, 2025, 1:55am
36
Thanks.
one more asking, where is the location of the picture uploaded into the APP through the design page's media.Upload File?
Taifun
July 24, 2025, 2:28am
37
these are called the assets
the assets are read-only
if you want
Taifun
1 Like
system
Closed
August 4, 2025, 12:34pm
38
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.