Multipart forms?

david bovill david at
Sun Sep 18 14:58:42 EDT 2005

Hi Dave,

On 18 Sep 2005, at 18:54, Dave Cragg wrote:

>     put "<file>" & someFile into tFile

Tried it - but no joy :(

I think it may be some local variable or call by reference thing /  
bug - can't follow debugger exits before going into  
"libUrlMultipartFormAddPart " function

on mouseUp
   answer file "Select a file"
   put it into someFile
   test_Add someFile
end mouseUp

on test_Add someFile
   put empty into tForm
   put "dave" into tName
   put "hello" into tMessage
   if libUrlMultipartFormData (tForm, "name", tName, "message",  
   is not empty then
     ##handle error and exit
   end if
   set the httpHeaders to line 1 of tForm
   delete line 1 of tForm

   put "<file>" & someFile into tFile
   put "image/gif" into tType
   put "binary" into tEnc
   if libUrlMultipartFormAddPart(tForm,"file", tFile, tType, tEnc) is  
empty then
     ##handle error and exit
     answer "Error"
     put tForm
     -- post  tForm to url
     -- set the httpHeaders to empty
   end if
end test_Add

More information about the Use-livecode mailing list