-2

I want to download multiple files from From URI(HTTP Request) and Zip that all files in one button click event. I have files like:

http://test.com/123.dox

http://test.com/1234.dox

http://test.com/1235.dox

want to that all files on one click and zip all them.

Please suggest me how to archive.

Askiitians
  • 291
  • 7
  • 18
  • Maybe this can help http://stackoverflow.com/questions/3984590/download-multiple-files-as-zip-in-net – t3hn00b Jul 02 '12 at 10:06
  • I am able to understand that how the files will be download from server as per given link. – Askiitians Jul 02 '12 at 10:11
  • Are the filenames known or do you want to crawl the website? For the zipping part, you can use a library, for example http://www.icsharpcode.net/OpenSource/SharpZipLib/ also you could use the commandline tools from winrar or most of the other populair software that is being used. Examples can be found at: http://devpinoy.org/blogs/keithrull/archive/2008/01/25/how-to-create-zip-files-in-c-with-sharpziplib-ziplib.aspx – Viezevingertjes Jul 02 '12 at 10:24
  • yes I know the file name and have file on amazon cdn server from there I want to download the files and zip them – Askiitians Jul 02 '12 at 10:42
  • 1
    [What have you tried ?](http://mattgemmell.com/2008/12/08/what-have-you-tried/) – Alex Jul 02 '12 at 10:58

1 Answers1

0

You can "Create a Zip as a browser download attachment in IIS" using SharpZipLib

see example on link http://wiki.sharpdevelop.net/SharpZipLib-Zip-Samples.ashx

You can pass the url's as list to read file's

Reading of files from url might require code from you please use below steps for it:

  1. Create file(s) request using HttpWebRequest.Create(FILE_URL)
  2. Get the stream object using HttpWebRequest.GetResponseStream()
  3. Read the content from stream and write it
HatSoft
  • 11,077
  • 3
  • 28
  • 43