I have discovered that HTTP PUT Request ist the most suitable for very large files upload (1GB or more).
The solution works well and I can upload any file of my choice to the server. However, I have difficulties monitoring upload progress.
I have implemented onprogress callback, but this one gets called only once after the file is uploaded via PUT.
My JavaScript Code:
var req = createRequest();
req.open("PUT", "PHP/upload_file.php?folder=" + aUploadedFile.upload_folder + "&master_folder=" + settings.strServerSideMasterFolder + "&file_name=" + aUploadedFile.file_name);
req.setRequestHeader("Content-type", "text/plain");
req.onload = function (event)
{
console.log("OnLoad Called: " + aUploadedFile.file_name);
}
req.onprogress = function (event)
{
console.log("OnProgress Called: " + aUploadedFile.file_name);
}
req.send(aUploadedFile.file_object);
- What are my options when i wish to monitor the upload progress via PUT, please?
- Should I establish another JavaScript AJAX call, that will monitor the size of the uploaded file o the server?
- Is there any other working solution available?
I use:
- HTML5
- JavaScript
- PHP
- Apache
I do not use:
- jQuery
Thank you in advance.