OT: PHP Assist

Dave Cragg dave.cragg at lacscentre.co.uk
Mon Mar 28 03:57:14 EDT 2011


On 27 Mar 2011, at 20:05, Dan Friedman wrote:

> Gentlemen,
> 
> My goal is to upload compressed data to a file on a sever.  I don't want to use ftp.  So, I am trying to use a php script.  I am getting Rev to POST the data, and I have a PHP script on my server that is writing the data.  The problem is that the data that is written is incorrect.  Not really sure if it's corrupted or if it's being wrapped with something or what.  I think I am POSTing the data correctly and the problem is in the PHP.  But, I could be wrong (wouldn't be the first time!).  Any assistance anyone has would be GREATLY appreciated!
> 
> Here is my script from LiveCode:
> 
> put "" into tPostData
> if libUrlMultipartFormData(tPostData,"DID",getDID(),"TID",sTeacherID) is not "" then
>  --there was an error.  deal with it.
> 
> else
>  set the httpHeaders to line 1 of tPostData
>  delete line 1 of tPostData
>  if libUrlMultipartFormAddPart(tPostData,"TDATA",rctDataToWrite,"application/binary","binary") is not "" then
>    --there was an error.  deal with it.
> 
>  else
>    put "http://www.myserver.com/folder1/saveData.php" into phpAddress
>    post tPostData to url phpAddress
>  end if
> end if

Does it make a difference if you use application/octet-stream instead of application/binary?

Also, are there are any limits on the maximum post size in PHP that might affect things?

Dave






More information about the use-livecode mailing list