0

I have a html webpage that I launch locally, and in this page I want to read some bytes of a very big file that is store in the same folder of this page.

./webpage.html
./BIGFILE

Is it possible with javascript to read a few bytes from the large file without loading it completely into memory?

Karoaty
  • 35
  • 4
  • 1
    If you were doing this on the server side using Node.js, you could definitely read just a few bytes of a file and stop there. I'm not aware of any browser-based way, however, that will only partially read a given resource. Since you've tagged this question with `jquery`, I'm assuming you need a browser solution. – kshetline Aug 26 '19 at 00:33
  • ReadbleStream to read a few bytes at a time. However, without an external XHR library, you would be sending a request for the whole file. I would suggest writing a server-side thing which would serve the file a few bytes at a time, if the file is large enough that a standard network connection would take more than a second to grab it. – Ben Aug 26 '19 at 00:36
  • See this answer: https://stackoverflow.com/a/15561674/3429323 – Elias Soares Aug 26 '19 at 00:37

0 Answers0