My app wites a csv file in a pre-defined folder on external memory (sdcard).
Name of the file is composed of date and time from the system (example: 2020-10-01- 12:24:41-Data.csv).
The file is saved alright.
When I want to "load" file, I use ActivityStarter to choose the files. I have problem how to specify the name and path of the file.
Tried several codes, but still unsuccessful.
Any help is really depreciated.
Sirous
Taifun
October 1, 2020, 1:42pm
2
how do you write that file?
are you talking about an external (removable) sdcard or an internal (emulated) sdcard?
you might want to try the file extension and its FileList method
see also the notes below the Copy method...
Taifun
Trying to push the limits! Snippets , Tutorials and Extensions from Pura Vida Apps by Taifun.
Its not removable. I'm sorry I made a mistake to write "external' in the original post. It is internal sdcard.
Could you pls provide an example?
Taifun
October 3, 2020, 5:08pm
6
Sirous_Nekooei:
an example?
see the Jukebox examle here App Inventor Extensions: File | Pura Vida Apps
Taifun
Anke
October 3, 2020, 6:09pm
7
What does "load file" mean?
If you only want to read it:
Thank you. But what if I have saved the file beforehand. What would be the "fileName" like?
Anke
October 3, 2020, 6:50pm
9
/test.cvs
The File component uses / needs the relative path.
Anke
October 3, 2020, 6:53pm
10
This might better show where I have problem with:
Taifun
October 3, 2020, 8:51pm
12
as already suggested
Taifun
PS: the correct mime type for csv files would be text/csv
Yes, it made things a little better.
In that example (jukebox) you choose a random music file. But I dont want random selection; I want the file selected by user.
Returns this error:
Bad arguments to -
the arguments: , [239],[/storage/emulated/0/test_folder/number_1.csv]
Taifun
October 3, 2020, 10:38pm
15
what you could do is to use the FileList method to get a list of all csv files of a given directory
then display these files in a listpicker and let the user select a csv file
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.
Taifun
Trying to push the limits! Snippets , Tutorials and Extensions from Pura Vida Apps by Taifun.
Anke
October 4, 2020, 8:16am
18
Check your blocks. It works fine for me.
And post a test aia.
Anke
October 4, 2020, 8:48am
19
Of course, it should be csv in my blocks.
Check this aia: listCsv.aia (32.5 KB)
1 Like