-
Notifications
You must be signed in to change notification settings - Fork 0
api upload
Jay Williams edited this page Mar 7, 2012
·
2 revisions
Uploading photo is a simple process with the API.
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.
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:
Afterupload.init
call, even if you have an error during the process, you need to callupload.end
to terminate the session. This clean up all temp files.