I have a folder with images and I'd like to have the image names displayed in a table, next to a corresponding customer number (which is pulled from a database) or if no image exists, then a noimage.jpg would disply as default. Can I do this in ColdFusion without having to reference image names from a database, etc.? For now, the images are just sitting in a folder. If so what code would I need to use? Thanks.
Probably. I don't need it to just print a list of files. I need it to display each individual image file name to the right of each record. Here is a screenshot of the tabel I have to add it to. Right after Territry, I need a column with 11871.jpg, 11899.jpg, etc and then any record without an image would show "noimage.jpg". Hope this makes sense.
Need to understand whether the database is driving the list, or are the contents of the folder driving the list. If you are looping through a query resultset from the database, that has the customer numbers and territory info, which is what it sounds like, then what you are really asking for (I think) is whether that customer's corresponding image file exists. In which case you want the cf function named, you guessed it - fileExsits().
If on the other hand you are driving this beast from whatever is in the folder, and looking for the corresponding data in the database, then use CFDIRECTORY and parse off the customer number in order to do the SELECT against the table. But I don't think that is the scenario you are describing.
Did either of those putts make it into the cup?
-reed
North America
Europe, Middle East and Africa
Asia Pacific