HTTP POST request doesn't work (and select file with filepicker to upload)

Well, you moved the goalposts by using the FilePicker, which returns a contenturi instead of a file path.

A quick fix is to use this extension:

which should convert your contenturi to a file path.

So in all my research I already tried this extension and this is what I got everytime

@Joejsanz - could you have a look at what your extension actually does? Seems it does not handle the more obtuse contenturis, only the ones that actually contain a file path of sorts.

1 Like

@Paulin_Roussel , will you pick files from the same directory, e.g. Download or Documents ?

If you put the GetAbsolutePath FromUri function directly and discard the MakeFullPath function, does it also give an error?

I did these tests, the other methods will give you uri, you have to put the GetAbsolutePathFromUri extension directly to give you the path.

@Joejsanz

See their contenturi

image

@Paulin_Roussel

You might try the Filetools extension which has a contenturi convertor:

image

Although the download link is currently dead ? @vknow360

or there is this extension which should solve everything...

That's right, something is wrong, after compiling the APK I get the error. I will review that code in the next few days.

Thanks....fixed :+1:

1 Like

Another solution: use the SAF extension (credits @vknow360), copy the picked file to a folder in your ASD, then get the filepath for that and POST it to your server.

(You can set the filetypes and initial directory to your liking)

You could also delete the file from your ASD folder, after uploading, if no longer needed.

1 Like

The document is an html page which is located in my download folder

I just saw your last message i m gonna try

So I recreate exactly what you did but when I choose the file nothing happed at all. Like the first bloc is working perfectly for choosing the file but then nothing.

html/* should be text/html

What do you see in Label2 ?

Is a file created in PickedFiles ?

Set another label to capture the uriString

Wait I didn't saw that message at first I'm trying right now and it's seems to work but the server don't respond let me checked

Not quite :wink:

You should also be using Web1.GotText NOT Web1.GotFile...

ok so there is the news

I tried the extension you send me and the path that I got look perfect BUT when I tried to read the file froim the path to verify it tells me that:

image

As expected, the JewelFilePicker stores a copy of the file in the private area of your app (companion) this is not (as in your case)/may not be accessible to other components.

Ok so apparently it can read the file by using the URI instead of the PATH.
So now I can read the file but when I tried to send it no response.
I'm trying to bluid the apk it keep disconnecting

Please try my SAF example with the corrections I suggested.