How to read a file asynchronously using javascript to download files

I need to read the file selected by the user to upload it to the server. And send the data read to the server and save it there. I am trying to implement a file download in which the user can pause the file download and resume it later. Therefore, for this I need to read the file from random positions. I found HTML 5 . But it is not supported in all browsers. So what any help?

Thanks in advance.

+4
source share
1 answer

you need to use technology that bypasses the browser security model .: - (

Javascript running in the browser does not have access to the file system for security reasons and likewise has very limited access to the file upload control. (for example, you do not want the browser to be able to safely upload files to a remote server)

A very popular open source project that allows you to bypass the SWF Upload security model to some extent. Unfortunately, out of the box, this does not allow you to do what you want, to create renewable downloads. This means that you have to either hack it (it's open source) or use another technology that is more convenient for you, for example, Java or a browser extension.

EDIT:

A new jQuery plugin has been announced that will help you exactly what you want. It was called plupload: http://plupload.com/

+3
source

Source: https://habr.com/ru/post/1334467/


All Articles