压缩并下载asp.net中的文件 [英] Zip and Download file in asp.net

查看:60
本文介绍了压缩并下载asp.net中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由某些服务创建的文件夹.
它包含多个子文件夹.
我想让网站的用户可以将整个文件夹下载为单个zip文件,而无需在系统中创建和存储zip文件.
那就是创建一个临时的zip文件并将其推送给用户.

在此先感谢您.

I have a folder that is created by some service.
It contains multiple sub-folders.
I want to give the provision to the users of a website to download the entire folder as a single zip file without needing to create and store the zip file in the system.
That is create a temporary zip file and push it to the user.

Thanks in advance.

推荐答案

我相信本文将为您提供所要查找的内容:在.NET 4.5中轻松创建Zip文件 [ ^ ]
I believe this article will give you exactly what you are looking for: http://www.4guysfromrolla.com/articles/092910-1.aspx[^]

Right now I believe you still have to use that third party library but in .NET 4.5, you can do this without a library because it is built in. I did an article on zip files in .NET 4.5 recently, although I didn''t discuss the web side of things. It might be of use to you in your planning, depending on if you want to use the latest version of .NET or not. Here is a link to the article, in case you are interested: Creating Zip Files Easily in .NET 4.5[^]


嗨.
您可能希望 SharpZipLib 我认为,借助该库,您可以压缩带有子文件夹和文件的整个文件夹.
祝你好运.
Hi.
You might look forward to SharpZipLib i think with help of this library you could compress entire folder with subfolders and files.
Good luck.


这篇关于压缩并下载asp.net中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆