Take photos and upload them to a remote server

Hi, I'm not a programming expert so excuse me if I say nonsense, I would like to send images taken with the camera to a remote server in a folder called "upload photos", I can't get it to work, I get stuck and I don't know how

to continue , can you help me? Thank you all

I guess we need to understand more about what is going on here:


What kind of server?
What is the full url?
Have you checked the path provided in "global img1" ?
Why are you using PUT ? (instead of POST...)
Can you "POST" a file using curl/postman ?

Here is an example using php....

Thanks for the reply.

  1. the server is on siteground
  2. the complete url where I want to save the images is https://mysite/images/upload.php
  3. the path of the "img1" is file://storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/Pictures/app_inventor_1683803670695.jpg
  4. I changed to POST

What is the response content in the Web.GotText event?


none, an "error 1109: the specified url is not valid " notification comes out first

but url is correct, if I try to open url via browser it gives me a message that I set

Can you please show your upload.php file contents....

// Simple PHP script to save image file.
$imgDir = "images/";
$fileName = $_REQUEST['fname'];
$data = file_get_contents('php://input');
$store = file_put_contents($imgDir.$fileName, $data);
if  ($store !== false ) {
echo "File $fileName saved to server, $store bytes\n";
} else {
echo "File $fileName not saved\n";

OK you are using the same php file as in my guide.

I notice you are supplying a full path as the image filename in the web url. You need to change this to just the filename. (see my guide)

Also try your url with curl or postman to test it. (see my guide)

hello, sorry if I reply late, I did as you told me, but I always get "error 1109", actually the url is correct


You are POSTing, so you cannot upload like that in a browser...

I'm sorry but I'm a beginner, can you help me?

Here an example:

Thanks for the reply, so I have to take the picture and then attach it? I would like to take the photo and send it directly


Looks like you have your upload.php inside the images directory. It should be in the next directory up. (See my guide, again....)

do you mean like this?

Error code 400

Yes. You changed your script from the one above. Makes it difficult to help.....

Have you tested with a curl command yet?

ok i brought it back as it was before

You need to set the web1.url block...

Hi, sorry if I reply late, I solved it following the example proposed by Juan_Antonio, Thank you all, you have been very kind