Search code examples
asp.netimagemap

How to Display Uploaded Image from File System


I'm attempting to modify an inherited project that has a convoluted process of displaying uploaded images using an ImageMap control.

The current process inserts a new database record with image file name as well as model number and part number. The image files are saved to a virtual directory visible to IIS. Each part number has a corresponding .htm file containing an image map referencing the uploaded image. The image map has to be sized for each part and saved in the file system.

How can I streamline this process using either client side or server side controls? I'd like to bypass use of image maps as they require manual sizing. Can a control be used that auto sizes the image? Should the images be stored inside the database or kept in the file system?

Thanks for your advice;)


Solution

  • Storing the images in the database is IMHO a much more scalable solution.

    Take a look at the Image Resizer project and its associated plugins for a way to resize the images, regardless of where you store them:

    http://imageresizing.net/

    http://weblogs.asp.net/bleroy/archive/2011/10/22/state-of-net-image-resizing-how-does-imageresizer-do.aspx

    http://nathanaeljones.com/163/20-image-resizing-pitfalls/

    You could use regular ASP.NET controls to display the images, for example, a ListView.