• 1.3k
  • 716
  • 1m

Problem with FileUpload1 control

Sep 10 2014 11:17 AM


I want to enable the user to upload file from whichever location on the disk the user wants. But when I use the code below, the user can only upload files from the location I have stated in saveas path. I just want to save the file there, but I want it to take the file from wherever user chooses from the disk.

Can anybody help me please how to enable the user to save the file in the stated path in the code, but to select it from whichever location she/he wants? Here is the code

if (this.FileUpload1.HasFile) { Response.Write(this.FileUpload1.FileName); this.FileUpload1.SaveAs(@"path" + this.FileUpload1.FileName); Label5.Text = "File Uploaded: " + this.FileUpload1.FileName; } else { Label5.Text = "No File Uploaded."; }

Thank you

Answers (4)