How to get HttpWebRequest range in javascript?

im doing a project where I have to take half the image from one source and the other half from another source, and then combine them together.

in C # it works as follows:

HttpWebRequest request1 = (HttpWebRequest)WebRequest.Create("URL");
request1.AddRange(0, 10000);
HttpWebRequest request2 = (HttpWebRequest)WebRequest.Create("URL2");
request2.AddRange(10000, 20000);

and then I read the streams, combined them into a buffer and write the buffer to a file.

now i need to create a plugin that does the same as far as i know i can create extension for firefox with javascript.

Do you think that you can do the same in javascript, or should I look for another method? I don’t even know how to create a plugin, so I don’t know if I can use any programming language (maybe I can even use C # or java to directly create a firefox plugin) can you give me some tips? many thanks

+3
1

, ajax

 $(function() {
  $.ajax({
    url: 'range-test.txt',
    headers: {Range: "bytes=618-647"},
    success: function( data ) { $('#results').html( data ); }
  });
});
+3

All Articles