Adds support for posting Image Token’s to a web site. Example use is for storing camera images on a web server.
Usage
Add a flow Send a Image
Add the Image token
Add a URL
Run and check the server
URL Receiver
You need to create a page on the “other side” that can receive a Form POST. Image will be stored with the ID “image”. Here you can find a simple example Upload it to your server and create a folder named images. Then point it out from the Flow e.g. http://yoururl.com/sendImage.php There is some simple logging done.
If you need a simple Gallery this one can be used: Simple Gallery
I gave the app a try, but it doesn’t seem to work completely. I have a PHP file on my web server ready to receive IMG files. I tested this PHP file through another method so I’m 99% sure it should work with this app. I made some logging on this website (like in your example) to check if something happened.
When I sent for example the last snapshot of my Ring doorbell with this app, I can see the action card is busy for approx. 2 seconds and after that shows a green checkmark. But it doesn’t trigger the PHP file. Even the log shows not a single entry (no success nor any error).
-edit: if you want, I can send you a diagnostic report-
Now that I’ve tested it a little bit more, I can conclude that it doesn’t seem to work for big(?) images. Snapshots from my Ring doorbell are not sent with this app, while smaller images are sent to my PHP and stored succesfully. Is there some known limitation to sending large files?
Hmm, have just tried with the images from my camera and I guess they are quite small. There is a known PHP settings that limits uploads to a PHP page to 2MB. Maybe it is this setting hitting the limit? There is a check you can do in the sample code I have that you can just add to your:
if ($file_size > 2097152) {
$errors = ‘File size must be exactly 2 MB’;
}
i just tried the App with that example PHP-Script on two different Server and with nearly every image i have in Homey available.
The result is always the same. The PHP-Script gets called but no image is send. The Log says “Error: No Image attached”.
Hmm. Strange. Just tried to make sure and my camera motion image are uploaded to my server without a problem. Im running it on my webhost with PHP 7.4 no special configurations or anything. Running the latest Homey version.
It seems that the problem is a misconfiguration of my server. I could not realy find out whats the problem
Anyway i just switch to a different server and now everything is working fine.
Thank you for your support.
This is so strange. I would guess its some updates to code libraries either on Athom or connected to my app. I will look in to it and see if I can reproduce.
I have been trying to use the ImagePoster app this week to send a picture from my camera to a php script on my server. All according to the instructions and scripts provided.
However, I seem to have a problem with the content-length specification in the HTTP header.
If I check out the code of the ImagePoster app and test it myself as a development app, then the post to my server works. It makes a difference if you install the app and run it on the homey. The request is rejected with a 411 error.
I have already tried to set the content-length manually. Something like this: