Hi MaxV,
thanks for the code you sent.
I tried immediately, but I get the result that the message format is wrong (HTTP Code 400)
For the image_to_send, I took
put URL ("binfile:"&Pfad) into image_to_send (where Pfad is the local file path on my desktop)
What do you think has to be placed in tFileName and tFileType ? I (successless) tried:
+ file file
+ file png
Perhaps it is easier to analyze if you have the concrete szenario. Here it is
<html>
<form enctype="multipart/form-data" action="
http://api.qrserver.com/v1/read-qr-code/" method="POST">
<!-- MAX_FILE_SIZE (maximale Dateigröße in Bytes) muss vor dem input-Feld
angegeben werden, über welches die QR Code Grafik hochgeladen wird -->
<input type="hidden" name="MAX_FILE_SIZE" value="1048576" />
<!-- Der "name" des Input-Felds muss "file" lauten, da es sich dabei um den
Namen des POST-Parameters handelt -->
Zu lesende / scannende QR Code-Grafik auswählen: <input name="file" type="file" />
<input type="submit" value="QR Code lesen" />
</form>
</html>
And here is the API for this service:
http://goqr.me/de/api/doc/read-qr-code/
Attached you find the image_to_send:
I hope you can help to find a solution.
Best Regards and many thanks for your further help in advance
Ulrich
MaxV wrote:The easy way:
I think you need this:
########CODE to copy and paste#######
put "name=" & urlencode(tFileName) into theParams
put "&type=" & urlencode(tFileType) after theParams
put "&value=" & urlencode(base64encode(image_to_send)) after theParams
post theParams to URL "http://xxx.com/a/b/"
#####END OF CODE generated by http://tinyurl.com/j8xf3xq with livecode 9.0.0-dp-5#####
Note that
tFileName, tFileType and
image_to_send are variable containing what you want. Please also note that
image_to_send must be filled with something like:
Code: Select all
put URL ("binfile:path/to/image/file.jpg) into image_to_send
On the server image must be base64decoded.
The hard way
If you want to use the multipart type of POST, then use
http://livecode.wikia.com/wiki/LibURLMultipartFormData