Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET MVC - I am having trouble storing and displaying an image in a database
    text
    copied!<p>I have been pulling my hair out about this since Friday and I am going nuts. I want to have the ability for a user to submit a form with an image, and have that image stored into a database. Then I want that image displayed on my index view.</p> <p>I have tried all of the other stackoverflow help topics on here already and none of them are working for me.</p> <p>I am following the directions in "Pro ASP.NET MVC Framework" by Steven Sanderson (pages 195-198), and it is just not working. It works great in his sample application that accompanies the book.</p> <p>I created a test MVC application which has the index and create views. It is saving something to the database because I can see the "Binary Data" field populated with those two words. But it won't display. I don't know if it won't display because I am saving the image to the database wrong, or something else.</p> <p>There is just way too much code to post here, but I compiled a simple application into a .zip file which shows exactly what I am trying to accomplish. I hope is allowed. Could one of you MVC experts please download it and tell me what I am doing wrong and why it doesn't work? I am at my wits end over this and I am so confused.</p> <p>Please let me know if you need any more info.</p> <p>Thanks so much, Shawn</p> <p>My file is located at: <a href="http://www.fraxis.com/test.zip" rel="nofollow noreferrer">http://www.fraxis.com/test.zip</a></p> <p>It was built using Visual Studio 2008 with .NET 3.5(SP1) and ASP.NET MVC 1.0.</p> <p>Everything is in the HomeController and the Home view. Index and Create. The database is in app_data.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload