Over the last few months i have done the following blog posts to explain how to handle images using MVC and various technologies like JQuery and Entity Framework. Now the majority of hits i receive are concerning these blogs posts, so obviously Image Handling is a common Achilles heel. The posts are also being referenced in forums to answer Image related questions. So i have decided to create a Open Source project which combines all of these blog posts into one solution for people to use. This project can be found here for anyone who wants to use it:
Codeplex: http://mvcimage.codeplex.com/
Github: http://garfbradaz.github.com/MvcImage/
At the moment it includes everything i have blogged about and shows you how to extend the RegisterModel to include adding Images when registering a new user. I will be adding the following to the project moving forward as i want this to an organic project that grows:
- Adding Thumbnails to the database and displaying these
- A details page of users so you can view their details and the images – A User Dashboard for the Admin
- A Image FileResult.
- A PDF document explaining what the Project does and where.
MY ORIGINAL BLOG POSTS – Image Handlers – JQuery/ASP.NET/SQL DB & Entity Framework (MVC3)
Tutorial 1 – Image Preview – JQuery
Tutorial 2 – Image Preview – HTML Helpers
Tutorial3 – Upload Image – SQL Server & Entity Framework
Tutorial 4 – Images – Downloading Images
Tutorial 5 – Thumbnail Support
Related articles
- treating my entity framework list as a list of poco (stackoverflow.com)
- MVC3 connection string with Entity Framework (stackoverflow.com)
- How to dispose objects correctly (ASP.NET MVC + Entity Framework) (stackoverflow.com)
I didn’t see the source code the bradaz DLL that is managing image processing. I found the very slow and not usable in an enterprise application.
LikeLike
Hey Bob,
Apologies for the delay in replying. I’m sorry you are finding it slow. Unfortunately I haven’t perfchecked this code, it was for learning purposes only but the theory is sound. The code for the DLL can be found here:
http://bradaz.codeplex.com/
Let me know how you get on.
Gareth
LikeLike
Gareth,
I have been working with your MvcImage code for several weeks and I am totally confused. Your code doesn’t seem to work with adding new images. There is no @Html.UploadImageFor code in the Create.cshtml like I would expect. Also, the [HttpPost] method in ImageController.cs does not match the code in your ‘Upload Image- SQL Server…’ blog. Do I not have the latest code?
Thanks,
Ken
LikeLike
I have my VM’s installed so i can start testing using SQL Express. I will get a new and refreshed post/code out within the week Ken.
LikeLike
Thanks. I’ll be looking for them. OBTW, great code for getting image sizes, etc.
LikeLike