0

I am at work and have a need to download large files, 4gb+. I only actually need the first 20mb of these files, however. To conserve bandwidth and time, I would like to only download the first 20mb instead of the whole file. Because I am at work and using Windows 7, I cannot install new software or compile anything. I saw, in the link below, that someone attempts to do this using Java. Because I have access to a web browser, I am able to make applications with Javascript. Is there a way to accomplish downloading only part of a file using only Javascript?

How do I download part of a file using Java?

0

1 Answer 1

1

You can send a HTTP RANGE request. This has little to do with JavaScript apart from the fact that you may send the request via AJAX

Sign up to request clarification or add additional context in comments.

4 Comments

hmm... This may not be the right route. Can you think of any other solution to my problem?
Well, "to download only part of a file", this is your best if not only chance. This may be tricky to achieve and requires correct server-side configuration/code to handle partial download properly.
Another way I can think of is if you handle it on server side entirely w/o RANGE request. What I mean is that you could send a request with parameters and those params would tell the server which part of what file you expect in response. Then server-side code can find the file, extract the desired part and send it back to the browser.
I don't have access to the server and it doesn't support range requests. :(

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.