Fail to read downloaded text file

I download a text file from Google drive, download is OK (web response code:200)
I extract the file path of the file and try to open it, but it fails:

Note: File Scope is set to App.

Here are the blocs:


and the project:
Test_Download_Text_File.aia (11.6 KB)

I know, I could download the text (setting Saverespose to false and directly get the text, but I woud like to save the file and read it later.

grafik

:question:

This is to extract the path, I reverse to find the "last "/" as there is only find the "first" and reverse it again. This is working fine, and as you can see the path is OK.
It is working fine when I read an mp3 file and ply it, so the pb is not in extracting the path

The File component uses a relative path, not an absolute path, as I've posted dozens of times. If FileScope = App the path is relative to the ASD, so just the file name.

Oooops, yes, File component is not using absolute path (and as you say, you mentioned this MANY times).
It is just confusing that different components have different behaviours
Thanks a lot for you great and so fast support :clap:

OK for Android without path, but unfortunately, it does not work for iOS.

What is the right way to read the downloaded file with iOS?

Most of the File component methods do not work with iOS. Among other things, the FileScope method (block) doesn't work either.

Thanks for your fedback.
According to the iOS implementation, ReadFrom is supposed to be implemented/working


@ewpatton Any idea when this will be fixed? Thanks

Yes, but only if the file was also saved with the File component. Obviously this path is different from the one the web component saves to. Unfortunately, we also have no way with iOS to find out the path that the File component uses for the app-specific directory (ASD) on iOS. Nor can we check the existence of a file, since the File.Exists method operates with FileScope.

So, I found a solution working for both iOS AND Android. I set SaveResponse to false, and when I get the text, I save it with SaveFile, then I can read it with ReadFrom. I do not know where it is stored, but it works!

Here are my blocs:

And my project: Test_Download_Text_File.aia (11.5 KB)

Thanks for your help

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.