Web Post File doesn't work and doesn't send file

I have to send files through my API made in php, via Postman everything works, but from kodular when I do the “.Post File” with the Web component it gives me an error: “Unable to post or put the file” / storage / emulated /0/Android/data/io.makeroid.companion/files/Pictures/kodular_1643300962700.jpg “with the specified URL etc etc.”
The URL is correct, from php I get all the $ _GET variables correctly but the $ _FILES array remains empty, I don’t know what to do anymore, I tried everything, I am attaching the piece of blocks that does the sending, help

Maybe this will help You :+1:


Why do you have a GET block? You are POSTing a file.

at this point I don’t understand if the Web .Post File needs the relative path or the absolute path

because I have to pass data to the API that the first is needed for authentication, the second indicates the id to be connected in the database, they are two simple data that I have to pass, then from php I take them with the $ _GET

1 Like

First try to upload one file instead of using for each number block(Multiple files)… if it is successful then instead of using this method just try to use clock component, there by if one file uploaded then second file will try to upload.

You should actually use the Web.GotText event to call the next file to upload…

1 Like

Complementing the suggestions above, a file-by-file example.


1 Like

I have a problem with the Post File not with the download of files, I created a test app, but the error I see is “Error 404 File Not Found” I also tried with the Image component and to load a simple image into kodular and even in that case I am returned File Not Found, what is the path of the file to pass to Post File? I can’t figure out if it’s the component that can’t find the file to send

I know that. I thought you would understand the example I posted…
Above you got suggestions to do 1 to 1 and use the Web.Got event.

So , I suggested that you look at that example for you to adapt to yours .

So the suggestions were:

1- check the file location ( POST 2)

2- use web.got ( POST 8 )

Have you checked the contents of your image list?
After take picture, did you, outside of your app, using a file manager, check the folder where the photos are?

And Read :point_down:

Maybe this will help You

You should be setting headers for this. Read the api documentation, or link to it so we can see how it works. It is not the correct method to try to send a POST “and” a GET request, they are two different and unlinked activities.

I also tried to insert the correct header, the problem remains, no files are passed, but it seems that it has never happened that someone with kodular has to send photos taken with the camera component via the web, it seems that I am the first to do it

Simply your server end - php for testing purposes, if you can get that working, then you can develop things on from there.

Have you checked where the photos are before trying to send them?

I tried this small and simple example, the result is always the same “File Not Found”, could you show me how I can fix this simple block to send the photo taken via Camera to the Web by Post File function?

It doesn’t help that you do not show your url elements (you can hide the address)
You do not show your php file…
Not sure why you are needing to remove brackets from your image path ?
Is your image path readable ?
What is your responseContent ?

Again ,
Have You checked ? :point_up:

One question : can it be by ftp ?
maybe this piece of blocks will do…

and …

Send it…