Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,

I am still very new to mvc, i want to be able to upload picture using html file upload control and display the image for the user at the same time, please how do i achieve this?
Posted

1 solution

You might get interested in reading the following forum thread: http://forums.asp.net/t/1976497.aspx?ASP+Net+MVC+5+Upload+Image+Save+to+Database+Create+Thumbnail+and+Display+in+View[^].

Also, MVC is just another framework, so the code you use in other framework would work just the way it would work in MVC too. Here is a document[^] for writing the same code in Web Pages. Remember, images are files after all so any code that can upload the file can also upload the image.

Displaying the image requires a simple <img></img> element. You can pass the name of the uploaded image to it and it will display the image inside your browser.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900