locked
Donload Zip Files From Server RRS feed

  • Question

  • Hi

    How Can i Download multiple Zip file From Specific Server and Upload it to Desired Server?
    Tuesday, May 26, 2009 11:24 AM

Answers

  • You can use the WebClient class as

    System.Net.WebClient client = new System.Net.WebClient();
    client.DownloadFile("http://www.fileserver.com/file.txt", "c:\\newfile.txt");
    client.UploadFile("http://www.fileserver.com", "c:\\filetoupload.txt");


    Thanks,
    A.m.a.L
    .Net Goodies
    Remember to click "mark as answered" when you get a correct reply to your question
    • Proposed as answer by Ajith R Nair Tuesday, May 26, 2009 2:11 PM
    • Marked as answer by Bin-ze Zhao Monday, June 1, 2009 2:14 AM
    Tuesday, May 26, 2009 12:22 PM
  • The files are in server rite.

    So the server must have the logic to zip.

    The client who is downloading need to have the logic for unzipping.


    Thanks,
    A.m.a.L
    .Net Goodies
    Remember to click "mark as answered" when you get a correct reply to your question
    • Marked as answer by Bin-ze Zhao Monday, June 1, 2009 2:15 AM
    Wednesday, May 27, 2009 7:21 AM
  • Hi,

    I think A.m.a.L has already answered your question.

    If you try to download zip files from ther server, it depends on how server did with these files. e.g.

    if server zip all the file one by one then you have to download them one by one. Furthermore asume server zips all the files into one zip file, you will be able to download just one zip file.

    Thanks
    Binze
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Bin-ze Zhao Monday, June 1, 2009 2:15 AM
    Thursday, May 28, 2009 8:00 AM

All replies

  • You can use the WebClient class as

    System.Net.WebClient client = new System.Net.WebClient();
    client.DownloadFile("http://www.fileserver.com/file.txt", "c:\\newfile.txt");
    client.UploadFile("http://www.fileserver.com", "c:\\filetoupload.txt");


    Thanks,
    A.m.a.L
    .Net Goodies
    Remember to click "mark as answered" when you get a correct reply to your question
    • Proposed as answer by Ajith R Nair Tuesday, May 26, 2009 2:11 PM
    • Marked as answer by Bin-ze Zhao Monday, June 1, 2009 2:14 AM
    Tuesday, May 26, 2009 12:22 PM
  • I have to download multiple Zip Files it might be 30 or more so do i have to zip all those file once again and then download or we have another way?

    Wednesday, May 27, 2009 5:16 AM
  • You can download one by one using the above code.


    Thanks,
    A.m.a.L
    .Net Goodies
    Remember to click "mark as answered" when you get a correct reply to your question
    Wednesday, May 27, 2009 5:36 AM
  • As i quote i have to download multiple  Zip Files from Specific Folder from my Server so rather than downloading  one by one is this possible that first we count how many zip files are there in folder and make one Zip of all and then directly upload to another Server?

    Wednesday, May 27, 2009 7:03 AM
  • If that is the case then you need to zip it in the server. And then download the file and unzip it.


    Thanks,
    A.m.a.L
    .Net Goodies
    Remember to click "mark as answered" when you get a correct reply to your question
    Wednesday, May 27, 2009 7:04 AM
  • Do i do it from my Local Machine?
    Wednesday, May 27, 2009 7:18 AM
  • The files are in server rite.

    So the server must have the logic to zip.

    The client who is downloading need to have the logic for unzipping.


    Thanks,
    A.m.a.L
    .Net Goodies
    Remember to click "mark as answered" when you get a correct reply to your question
    • Marked as answer by Bin-ze Zhao Monday, June 1, 2009 2:15 AM
    Wednesday, May 27, 2009 7:21 AM
  • What i mean there are multiple Zip files resides on server which i need to download.
    so first what i need is if there is 50 or more zip files are there in folder from where i have to downlaod It Zip all those 50 already Zipped File in one and the upload to
    another Server and unzip all file.

    Wednesday, May 27, 2009 7:35 AM
  • do somebody reply on this?
    Thursday, May 28, 2009 5:39 AM
  • Hi,

    I think A.m.a.L has already answered your question.

    If you try to download zip files from ther server, it depends on how server did with these files. e.g.

    if server zip all the file one by one then you have to download them one by one. Furthermore asume server zips all the files into one zip file, you will be able to download just one zip file.

    Thanks
    Binze
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Bin-ze Zhao Monday, June 1, 2009 2:15 AM
    Thursday, May 28, 2009 8:00 AM