Save Image to mySQL and Retrieve Image?
Dave Cragg
dcragg at lacscentre.co.uk
Tue Jun 9 02:27:04 EDT 2015
> On 8 Jun 2015, at 23:10, JOHN PATTEN <johnpatten at me.com> wrote:
>
> Hi All,
>
> I have a a mobile app that takes a photo and POSTs the base64Encoded image to an .lc server script that saves it to a mySQL field.
>
> set the vis of templateImage to false
> mobilePickPhoto "camera"
> put the last image into img "imageHold"
> put the text of image "imageHold" into tPhotoData
> put base64Encode(tPhotoData) into tPhotoData
> set the cImageData of img "ImageHold" to tPhotoData
> reset the templateImage
> put urlEncode(cd fld "comments") into $Comments
> put the cImageData of img "imageHold" into tImage
> put "comments=" & $Comments & "&image=" & tImage into tArgList
> post tArgList to URL "http://servername.on-rev.com/ipad_1/add_image.lc”
>
Shouldn’t you urlEncode the base64 string? It can contain characters such as '+', '/', and '='.
Cheers
Dave
More information about the use-livecode
mailing list