Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 22nd, 2007, 02:05 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default Multiple Image Upload/Display

Hi,

I was wondering if I could get some input on uploading and displaying multiple images for products. I've only always done just one image per product using the database ID for the name of the image when uploading the image, [ID].jpg, etc. And then its pretty easy to display the image, as long as you only have one image. I want to do something like the way its done on craigslist.com. You can Browse to at least four images and then upload them all at once. The uploading is not the problem. I got that covered. The problem is how do I organize them and then display them. I don't want a gallery or anything fancy like that.

I was actually thinking of creating a folder for all of the product IDs and then dumping multiple images to the folder, naming them a.jpg, b.jpg, etc., then read the entire folder when the image is selected, maybe just redraw the images as thumbnails first.

I may be over thinking this thing.

Any suggestions would be greatly appreciated.

Thanks,
Richard

 
Old February 22nd, 2007, 02:19 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

IMHO, I would store the images in a database, of course that is just me.

In so far as relating images to products and such, I would create a table in your database that stores the path to the image and the id that that image relates back to. (I think this will save you a lot more headaches then setting up an elaborate naming convention)

so when a user would navigate to X product, you could pass in the id through a stored procedure something like

SELECT imagePath from <table> where productID = @id

then in code you could add images dynamically to the page:

foreach(DataRow dr in dt.Rows)
{
Image img = new Image();
img.ImageUrl = Convert.ToString(dr["path"]);
//add img control to a container control
}

Or something similar to that.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
 
Old February 22nd, 2007, 03:22 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Thanks d. That was actually one of the options I was considering. That way it would also allow me to set status and priority on the images too, set one of the images as the primary so that I can display just one main image when needed on other pages.

Very much appreciate the response. Thanks for the feedback.

Richard

 
Old February 22nd, 2007, 03:25 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

No problem ^^

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429





Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload image-create & save thumbnail-display image angshujit ASP.NET 2.0 Professional 6 July 11th, 2013 10:34 PM
image upload and display VIRUS AND TROJAN ISSUES machochm Classic ASP Professional 0 February 11th, 2008 02:18 AM
image upload & display on Applet Kiran Kumar Classic ASP Basics 1 March 17th, 2006 05:56 AM
Image upload cutesneakers PHP How-To 2 January 5th, 2005 08:00 AM
upload/display image alitoday Classic ASP Basics 4 June 28th, 2004 01:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.