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.";
}
}
Anchal Kesharwani
20-Sep-2014You can use GZipStream class.