We are trying to upload a zip file using the "FileReader" javascript object on the client. For small files, everything seems fine. If we use the 132Mo zip input file in Firefox v21.0 on Windows 7, the first boot from a local drive through a javascript object works well. But, if we try to select another file and start the transfer, Firefox will work .... In Chrome v27.0 in Windows 7, it crashes on the first try (see the "oups" page). We tried on Mac OS with the same browser without any problems. Mostly strange, but when the Windows Task Manager window is open, there are no more crashes in Firefox or Chrome when downloading large files. Perhaps the presence of this TOP window makes the garbage collector do its job faster?
Has anyone already encountered this problem? As a link, I joined a simple HTML page that can reproduce behavior.
<!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title></title> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#btnFile").change(startUpload); }); function startUpload(e) { this.fileHandle = e.target.files[0]; var reader = new FileReader(); reader.onprogress = function (data) { if (data.lengthComputable) { var progress = parseInt(((data.loaded / data.total) * 100), 10); $("#progress").html("Reading file: " + progress + " %"); } }; reader.onloadend = function () { $("#progress").html("Reading completed!"); }; reader.onerror = function (errorEvent) { console.error("FileReader error", errorEvent); }; reader.readAsDataURL(this.fileHandle); }; </script> </head> <body> <input type="file" id="btnFile" /> <div id="progress"></div> </body> </html>
source share