[ 
https://issues.apache.org/jira/browse/SHINDIG-1136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738311#action_12738311
 ] 

Chris Chabot commented on SHINDIG-1136:
---------------------------------------

If i understand the spec correctly, uploading to RPC is possible when using 
multipart/form-data, in which case the RPC json body should be in the 'request' 
field, and the binary data would be available through the $_FILES superglobal. 
I don't think we've actually implemented that 'request field' functionality 
yet? See 
http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/RPC-Protocol.html#rfc.section.13
 in the RPC spec

Since uploading to the REST endpoint is basically a post with Content-Type: 
{image,video,audio}/* and the post body == the binary data, it seemed like a 
simpler design to me to always just hand off the binary data blob as a variable 
to the container's implementation, instead of counting on it to do 
move_uploaded_file, since in this situation there is no uploaded file, so the 
only way to make the REST and RPC posts with binary data attached to it 
consistent for the service layer, is to save the uploaded data to a new 
temporary file, and pass that file name + all the other data we know about the 
upload type to the SPI. That does mean the container will have to do it's own 
moving, but at least the container wouldn't have to worry about the incoming 
request format.

We could also just pass a $data containing all the binary info around, but with 
video uploading and all that, that would probably run out of memory way to 
quickly, so temp files seem to be a better way to go :)



> Content upload for php shindig
> ------------------------------
>
>                 Key: SHINDIG-1136
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1136
>             Project: Shindig
>          Issue Type: New Feature
>          Components: PHP
>         Environment: php 5.2.4
>            Reporter: Jinhui Du
>
> The URL for code review is http://codereview.appspot.com/98103/show

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to