create a byte[] froma url

  • Thread starter Thread starter tessellated
  • Start date Start date
T

tessellated

Hi all,

I have various urls which point to .xls files. I wish to read
iteratively read those files into memory so that I can turn them into
byte arrays and do further operations on them. The constructor for
System.IO.FileStream does not support URI's. What other tools are out
there for accomplishing this?

Thanks!
 
Ummm, doesn't that just encode into a byte array the string literal of
YourURL? :P

I want to dump the actual contents of the xls file pointed to by the
url into a byte array, or even better I'd be happy if I could put that
file into a stream and access it that way.
byte[] URLInBytes = System.Text.Encoding.UTF8.GetBytes(YourURL);


--
Salvador Alvarez Patuel
Exony Ltd - London, UK


tessellated said:
Hi all,

I have various urls which point to .xls files. I wish to read
iteratively read those files into memory so that I can turn them into
byte arrays and do further operations on them. The constructor for
System.IO.FileStream does not support URI's. What other tools are out
there for accomplishing this?

Thanks!
 
WebClient wc = new WebClient();
byte[] b = wc.DownloadData("Http://yourUrltoExcelFile.xls");

I'ts in the System.Net namespace.

I cannot imagine what kind of manipulation you expect to be able to do with
an XLS Excel workbook file as a byte array, however.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top