0

I'd like to pre-visualize an image in a image box before save it in a directory. How can i do this, i use a checkbox to see if the user wants to pre-visualize or not because i dont find another way to do this without a checkbox. I use file upload to upload the image.

string serverFileName = "";
serverFileName = Path.GetFileName(Upload.PostedFile.FileName);
Upload.PostedFile.SaveAs(MapPath("~/fotosPerfil/") + serverFileName);

i use this piece of code to save the image.

John Saunders
  • 157,405
  • 24
  • 229
  • 388
Severiano
  • 983
  • 3
  • 23
  • 51

1 Answers1

1

I think this post is exactly what you need to implement. Check out Ivan's solution.

Yes, indeed you can read the path selected by the user and display the image in an <img> tag, all client-side prior to uploading.

Community
  • 1
  • 1
Pablo Romeo
  • 10,870
  • 1
  • 27
  • 57