Search code examples
ajaxhtmluploadfilereaderchunking

HTML5 File API and AJAX Upload Chunking question


I have written a drag and drop multiple file upload with individual progresses, etc. It works very nicely, except for one thing. when uploading larger files, sometimes the browser will lock up until the upload is complete. I think this is because the file is being stored in the browser's memory and taking up all the resources available to the browser. what I'm wondering, is it possible to read files piece by piece and stream the chunks through an Ajax request as they are read? I think this might possible with FileReader but I haven't worked with it.

I'm sorry I can't provide any code as I am on my smartphone, but I will post some when I get a chance if it is needed.


Solution

  • I found the answer if anyone happens to have the same issues I had. Here is a link with the solution: http://www.thecssninja.com/javascript/fileapi