You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jay Williams edited this page Mar 7, 2012
·
2 revisions
Upload
Uploading photo is a simple process with the API.
How a file is uploaded...
The file is cut into small part so that each of them never exceeds the max size limit.
Each part, called a chunk, is base64 encoded and are uploaded separately.
NOTE:
Becareful, base64 encoding made the chunk growing by a 4/3 ratio. Max-size is provided for the base64 size.
Upload protocol...
First at all, you need to create a upload session by using upload.init, once is done, you can upload each of your file chunk with upload.send.
When chunks upload is finish you call upload.end to concatenate all chunks and re-generate the whole file on server side.
NOTE:
After upload.init call, even if you have an error during the process, you need to call upload.end to terminate the session. This clean up all temp files.