Create Zip Files Archive In Asp.Net C#

Spread the love


protected void btnUpload_Click(object sender, EventArgs e)

{

if (fileUpload1.HasFile)

{

string fileName = Path.GetFileName(fileUpload1.PostedFile.FileName);

string fileLocation = Server.MapPath(“~/UploadedFiles/” + fileName);

fileUpload1.SaveAs(fileLocation);

 

ZipFile createZipFile = new ZipFile();

createZipFile.AddFile(fileLocation, string.Empty);

createZipFile.Save(Server.MapPath(“~/CsharpAspNetArticles/CsharpAspNetArticles.zip”));

}

}

Bir yanıt yazın

Bu site, istenmeyenleri azaltmak için Akismet kullanıyor. Yorum verilerinizin nasıl işlendiği hakkında daha fazla bilgi edinin.