how do you post large files to lc server or php script?

Matthias Rebbe matthias_livecode_150811 at m-r-d.de
Tue Jun 6 16:37:27 EDT 2017


Hi

how do you post large files to a php or lc server script?

I am noticing  problems when doing the libURLMultipartFormData stuff.
In my case even a  2mb jpeg file causes LC 8.1.2, 8.1.4RC3 and LC 9 DP6 (did not try other versions)  to be very unresponsive right after i called that function.
For example the following script,, executes until the end. I can hear the beep and i see the formdata in the message box  but it takes
30 to 40 seconds and longer until i am able to edit/use the LC editor again. Sometimes LC stays unresponsive until i force quit  and restart it.
Tried also other file types, not just jpeg.


   put empty into tFormData
   put "https://myserver.com/upload.lc <https://myserver.com/upload.lc>" into tUrl
   put "upload" into tAction
   put “/Users/matthias/Desktop/Scan.pdf” into myFile
   put "<file>" & myFile into tFile
   
   if  libUrlMultipartFormData(tFormData,"action",tAction,"userfile", tFile) is not empty 
   then
      answer it
      exit to top
   end if	
   put tFormData
  -- set the httpHeaders to line 1 of tFormData
  --post line 2 to -1 of tFormData to url tUrl 
  -- put the result &return &it
   ## check the result, etc., here
  -- set the httpHeaders to empty
beep


Am i missing something? 
Can i use a tsNet command/function to post to a server script w/o using the libURLmultipartformdata function? Or is there an other way to post larger files?

Regards,

Matthias


Matthias Rebbe
+49 5741 310000
‌matthiasrebbe.eu <http://matthiasrebbe.eu/>‌




More information about the use-livecode mailing list