Allora ho creato il seguente programma per vedere se funziona:
confermo che funziona. Potete scaricarlo da qui.
Il codice sorgente è questo:
on mouseUp put empty into tForm put "http://api.qrserver.com/v1/read-qr-code/" into tUrl put the filename of image 1 into tFile put "<file>" & tFile into tFile if libURLMultipartFormData(tForm, "name","file","type","file", "file", tFile) is not empty then answer it ##error else set the httpHeaders to line 1 of tForm post line 2 to -1 of tForm to url tUrl put it into field "rawdata" ## check the result, etc., here set the httpHeaders to empty put jsonimport(the text of field "rawdata") into temp put temp[1]["symbol"][1]["data"] into field "text1" end ifend mouseUpVediamo come funziona: l'immagine deve essere spedita ad una pagina web. Il creatore della pagina web vuole ricevere via POST:
- una variabile chiamata name, che contenga la parola file
- una variabile chiamata type, che contenga la parola file
- il file dell'immagine
Nessun commento:
Posta un commento