Error message using extension HttpClient.PostForm

Yes, but your app does not own it
I think, if you use the content uri directly with the File.ReadFrom method you should be able to read the file... first set File Scope to Shared or Legacy

Taifun

It doesn't work even with shared or legacy; I get Error 2101 the file Documents/participants.cvs could not be found

Here is the php script on my server which receive file posted.

I tested it with the following html form, and it works. I got the message ::white_check_mark: Fichier reçu et enregistré...

Do you mind if I test? I will use this image so you can find it and delete if I have success:

ukmricon

We have two things to resolve:

  1. Getting an imagepath that works
  2. Checking that the extension can upload

To read the file you did not follow the suggestion, which was

Taifun

here is the result with uri directly connected to File.ReadFrom.

Yes you can test my project
TesttHttpPostFile.aia (24.7 KB)

OK, I setup my own php and html files on my own server, following your files to the letter.

Can upload a file to the server using the form html file.

In testing I also was UNABLE to use the extension to upload a file.

Methinks there may be an issue with the extension with regard to setting file paths...

Hopefully, @Kevinkun can help out with this?

Does the app need to be compiled for this to work?

mpForm.html.txt (475 Bytes)
get_file.php.txt (374 Bytes)

According to the guide provided for the extension, the upload blocks should look like this:

given a filePath of (for example)

image

for a file that is created by the app.

Also tested with files in ASD.

You forgot to mention, if you now can read the file without error
What do you get in the File.GotText event?

Taifun

Yes I was able to read without error. After reading the file I wrote a text with file.append method in a new file and I found this file after with the text into it.

Ok thanks a lot for ttime ou spent to help me. I have seen on our website METRIC RAT AI2 the guide UpLOAD Any File To Google Drive with AI2. I will consider it as a replacement of the HttpClient.PostForm extension. My project i s to build an App to register participant to an activitie (ex: walking). Each participant will be identified by mean of a QR code. My App will scan each participant and create a csv file containing data of each participant. After the list is completed, the file will be send to google drive to be imported in a database (mysql) . All these data will be used to make some statistics and other things.

You could always try a file upload php without multipart, to keep things on the website...

Some examples here

Ok I will have a look to this other way

I tested your first example. It works well when I pick a file , i can post it without problem.
When I try to use that in my final project it doesn't work. I have an error 1104: Enable to complete the given request with the file adherent.csv with the specified URL https://retraitesportivestgilles.fr/upload.php?fname=adherents.csv
I create the csv file first by clicking on btnSauveListeToCsv, then I click on postFile. You can see my blocks. When I test that the file exits, I have the message : file found. Whats wrong ???

If I remember correctly, PostFile will require an absolute path:

/storage/emulated/0/Android/data/<packageName>/files/adherents.csv

Just tested, this works: