How to change fileupload name

Posted by Domnic on Stack Overflow See other posts from Stack Overflow or by Domnic
Published on 2010-04-12T11:11:05Z Indexed on 2010/04/12 11:13 UTC
Read the original article Hit count: 279

Filed under:

im using following code to upload

protected void UploadButton_Click(object sender, EventArgs e) { if(FileUploadControl.HasFile) { try { string filename = Path.GetFileName(FileUploadControl.FileName); FileUploadControl.SaveAs(Server.MapPath("~/") + filename); StatusLabel.Text = "Upload status: File uploaded!"; } catch(Exception ex) { StatusLabel.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message; } } }

i want to cahnge upload file name...i have to assign file name for every uploaded file how?

© Stack Overflow or respective owner

Related posts about ASP.NET