3
votes

I am currently trying to upload files to Alfresco CMS and i have two approaches

  1. Use submit the file as multipart POST request
  2. Upload the file as chunks from the client and then reassemble the chunks on the Alfresco side using Web Scripts.

Which approach is better and why?

I did some research online on the two approaches

difference between multipart and chunked protoccol

How does HTTP file upload work?

Why is form enctype=multipart/form-data required when uploading a file?

But still unable to conclusively determine the pros and cons.

PS: The size of files being uploaded can range for 5 MB to 2 GB.

1

1 Answers

3
votes

I think use of second approach

Upload the file as chunks from the client and then reassemble the chunks on the Alfresco side using Web Scripts

will be better, the reason being Form submission is synchronous and will block browser usage until the whole file is uploaded which in your case is pretty big, Using client side script to send your data will enable you show upload progress to end-user and provide you the ability to resume/restart upload in case of any network error during file upload.

You can read this article for more details http://creativejs.com/tutorials/advanced-uploading-techniques-part-1/