0

Using Java Script we can read a file (selected using type="file") bytes by bytes of any file using myfile = new FileReader();.

This page has a nice example : HTML5 File API read as text and binary

My question is can we do similar stuff using any file which is already hosted in any server like

http://localhost/file.bin

Community
  • 1
  • 1
Dev.K.
  • 2,428
  • 5
  • 35
  • 49

1 Answers1

0

you can't unfortunately, the fileReader api is for local files only.

you do have some options thogh, you could use a http/xhr request to download a online resource, save it to a local server and then pass the local file path to the fileReader api, but you can't do it directly from a URL

atmd
  • 7,430
  • 2
  • 33
  • 64