1

I would like to know if there is anyway to use Httprequest or Webclient to read data from an URL (The link is not valid because i changed a little bit because there are private data there).

Like: https://download.somewhere.com/ReportDownload

The link above is pretty much the format, from the link, you can download a zip file with a CSV file in it. I am wondering if there is a way to use C# to parse out the data instead of downloading it, unzip it and read data from the csv. I would like to get the data and pass that to a variable without any physical download.

Kami
  • 19,134
  • 4
  • 51
  • 63
Yun Ling
  • 51
  • 1
  • 2
  • 7
  • If the provider zips the file and provides no provisions for an uncompressed download - It is not possible. – Kami Oct 10 '13 at 15:22
  • Try looking at [this SO question and answer](http://stackoverflow.com/questions/4769032/how-do-i-download-zip-file-from-c-sharp-code). Its got some code there that you can pretty much copy and change to suit your needs. What you'll do is download it, then use the [Zip Class](http://msdn.microsoft.com/en-us/library/system.io.compression.zipfileextensions.extracttodirectory.aspx) to unzip it programmically and get your data. – Icemanind Oct 10 '13 at 17:58

1 Answers1

0

If the file provider/site is yours, then yes. You can write a webservice method for that or something like that.

If not, that's not possible. But you can download it to a temporary folder, read it, parse it and delete it aftwerwards.

Hope it helps.

Joel
  • 7,401
  • 4
  • 52
  • 58