Situation
I am trying to build something to download a file from several mirrors at the same time. The mirrors support resumable download (thank to http partial content and so on...) so I am able to download all the pieces from different location and when everything is here to let the user "download" it thanks to the well known window.URL.createObjectURL
. I stole most of the code there : Handle file download from ajax post
But with the approach of the linked question there are 2 major drawbacks for my project :
- The download needs to be completed for the download dialog box to show up.
- All the data is managed by the browser's cache and memory.
Question
Is there any way to show up the download dialog box before the end of the download (before calling window.URL.createObjectURL
) ? and to update the chosen file later as pieces arrive.
I was looking of something like php's fopen
/fseek
/fwrite
for the file update.
I looked at the File API but found nothing about writing data. I also thought using local storage but all the same all the data would have to be downloaded prior to offer the download dialog box.
EDIT
How I see things :
I want to know if there is a way to download a generated content just like a regular download : to let the user choose the download target file and only then complete the download in user space tempfilename... (move the surrounded box after the SaveAs and change it for user space instead browser space)