简体   繁体   中英

.NET download one Zip file when files are on different server

my users upload their files in my Web Application and the application saves their files in the server that has the most free space. The result is that one folder of a user may contain multiple files that are saved in multiple servers.

Now i want to give my users the option to download their whole folder as a ZIP file.

Can somebody provide an appropriate namespace or guidance of what will be the best practice to achieve this functionality?

The application is written in C# .NET. So far i saw

1) http://msdn.microsoft.com/en-us/library/system.io.packaging.aspx

together with

2) http://msdn.microsoft.com/en-us/library/system.io.packaging.zippackage.aspx

Am i looking at the right direction?

Let say a user has his files over 3 servers named server1,server3 and server6 point 1. You must have those locations somewhere? right?

now suppose server7 needs to pack those files into 1 zip and stream to the client.

You will need to download all those files to server7 and then pack those files to zip archive.

To download the files you can use webrequest method. Hope this is clear.

YOU WILL NEED TO DOWNLOAD THE FILES TO A SINGLE LOCATION BEFORE ZIPPING THEM, there is no shortcut over this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM