There's a way to download large files direct from server? (Without waiting for blob response)

Viewed 556

So, I'm working on the request of video files (using axios). I made the requests w/ the responseType: blob and wait for the response to create the video player with the window.URL.createObjectUrl(). But I've a button too, when the user click he can download the file.

The problem is: most files has big sizes, 150MB+, which turns out to be terrible for the user to wait for the blob response and start downloading.

There's a better way to do that? Without waiting for the response and making the browser handle the request?

1 Answers

It's not possible to do better through an XHR request (beside displaying a loading element while waiting for request response).

But why can't you just pass it through the browser (using the <a> element on-the-fly creation trick)? If you paste your end-point on browser's location bar, doesn't it open or download it?

Related