Posting binary data -- followup
Devin Asay
devin_asay at byu.edu
Tue Dec 14 17:26:48 EST 2010
It's got two things in it: line 1 contains the custom http headers needed to submit the post request, and lines 2 to the end contain the actual posted form data.
The URL referred to by Dave Cragg in my previous email explains it in more detail.
Devin
On Dec 14, 2010, at 3:21 PM, Alejandro Tejada wrote:
>
> Hi Devin,
>
> Just out of curiosity:
> What is the content of the variable "tForm"?
>
> Thanks in advance
>
> Al
>
>
> Devin Asay wrote:
>>
>> I followed the example at that URL and it worked like a charm. I used this
>> script, which also displays the multipart form data so you can see what's
>> going on behind the scenes:
>>
>> on mouseUp
>> put empty into tForm # create the variable
>>
>> put "Devin" into tName
>> put "2010-12-13" into tDate
>>
>> answer file "Choose file: "
>> if it is empty then exit mouseUp
>> put "<file>" & it into tFile
>> if libUrlMultiPartFormData(tForm, "name", tName, "date", tDate,
>> "file", tFile) is not empty then
>> answer "error:" & it
>> else
>> set the httpHeaders to line 1 of tForm
>> put tForm into fld 1 -- shows the multipart form data in a field
>> post line 2 to -1 of tForm to url
>> "http://some.server.com/test_post/a_script.cgi"
>> -- answer the result -- for debugging: displays error, if any
>> set the htmltext of fld 3 to it
>> -- put it into fld 3: uncomment to show raw html
>> end if
>> end mouseUp
>>
>> Hope this is helpful to someone.
>>
>> Regards,
>> Devin
>>
>
> --
> View this message in context: http://runtime-revolution.278305.n4.nabble.com/Posting-binary-data-tp3047407p3088111.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
Devin Asay
Humanities Technology and Research Support Center
Brigham Young University
More information about the use-livecode
mailing list