在這裏我有幾個圖像,我需要壓縮這些圖像,並需要下載它..在這裏我使用Ionzip。問題是zip不工作,它不顯示我有任何錯誤。zip does'n讓我看到任何問題
mycode的
public bool DownloadImgs()
{
string Path = HttpContext.Current.Server.MapPath("../Content/images/QImages");
string zippath = HttpContext.Current.Server.MapPath("../Content/images/QImages/zipped/");
string[] filenames = System.IO.Directory.GetFiles(Path, "*.jpg", SearchOption.AllDirectories);//It returns all the paths of the images.
using (ZipFile zip = new ZipFile())
{
foreach (String filename in filenames)
{
ZipEntry e = zip.AddFile(filename, "");
}
zip.Save(zippath);//In here i need to download the zipped file.not to save
}
}
PS:此應用程序使用MVC框架
所以zip不會生成,但是你要下載它呢? –
@StevenLemmens No.zip文件沒有創建..但是我需要下載它 – UDP