I want to upload image in my form .i don't want to save image on server before submit. i want to save image on the server click on the submit button .
Asked
Active
Viewed 1,185 times
1 Answers
1
if(FileUpload1.HasFile){
string absolute_path=MapPath("~/" + FileUpload1.FileName);
string relative_path="~/" + FileUpload1.FileName;
FileUpload1.SaveAs(absolute_path);
Image1.ImageUrl=relative_path;
}
You can use this code for uploading an image.
If you want to save after a button click then write like this
private void ButtonUpload_Click(object as Sender...)
{
FileUpload1.SaveAs(absolute_path);
}

Kishore Kumar
- 12,675
- 27
- 97
- 154
-
thanks for reply but i want to upload multiple image . using this we can only upload only one image – pargan Mar 23 '12 at 08:33
-
-
yes alex i want to upload Three images . but on upload i also want to show image to user. after that then the user submit images and other information save on the server. – pargan Mar 27 '12 at 05:13
-
1