Send image with command "post"
Posted: Mon May 25, 2015 11:11 am
Hi
I need to send a picture taken from Androids camera to a server where mysql is running. I can do this only through port 80/8080 (http). Therefore I think I need to submit my data with the post-command. I wrote a php script that acts as API. The API-PHP script receives the data and sends them to mysql.
This works fine with normal text variables, but not with images. As they are arrays I don't know how to send them with post.
Thanks a lot for help
David
That's what I am trying with livecode (Name, Vorname, Mail and Channel work fine but tFile is not being transmitted:
set the width of the templateImage to 295
set the height of the templateImage to 170
set the left of the templateimage to "20"
set the top of the templateimage to "50"
set the lockLoc of the templateImage to true
set the name of the templateImage to "camPict"
mobilePickPhoto "Camera"
export image "camPict" to tFile as jpeg
put "Name=Rene&Vorname=rafi&Mail=mymail&Channel=22&File=" & URLEncode(tFile) into tArgList
post tArgList to URL "myserver/api.php?"
I need to send a picture taken from Androids camera to a server where mysql is running. I can do this only through port 80/8080 (http). Therefore I think I need to submit my data with the post-command. I wrote a php script that acts as API. The API-PHP script receives the data and sends them to mysql.
This works fine with normal text variables, but not with images. As they are arrays I don't know how to send them with post.
Thanks a lot for help
David
That's what I am trying with livecode (Name, Vorname, Mail and Channel work fine but tFile is not being transmitted:
set the width of the templateImage to 295
set the height of the templateImage to 170
set the left of the templateimage to "20"
set the top of the templateimage to "50"
set the lockLoc of the templateImage to true
set the name of the templateImage to "camPict"
mobilePickPhoto "Camera"
export image "camPict" to tFile as jpeg
put "Name=Rene&Vorname=rafi&Mail=mymail&Channel=22&File=" & URLEncode(tFile) into tArgList
post tArgList to URL "myserver/api.php?"