forum

Home / DeveloperSection / Forums / Compress a file while upload the file is possible in asp.net?

Compress a file while upload the file is possible in asp.net?

Anonymous User193520-Sep-2014

here i browsing a file and elect and that i clicking button to transfer currently the file ought to compress and will not be save in nothing format.as it is that if i transfer pdf it should be compress and save in a very folder as pdf format...please create this code on behalf of me...

protected void btnUpload_Click(object sender, EventArgs e)
   {
       if (fileUpload.HasFile)
       {
           string filename = Path.GetFileName(fileUpload.PostedFile.FileName);
           string path = Server.MapPath("~/SampleFiles/" + filename);
           fileUpload.SaveAs(path);
           lblTextMsg.Text = "File Uploaded Successfully.";
       }
   }


Updated on 20-Sep-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By