Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfdirectory and thumbnails 1

Status
Not open for further replies.

CTekMedia

Programmer
Oct 5, 2001
634
US
I like using cfdirectory to provide hyperlinks/files for my intranet users. Some of these folders contain .jpgs. It would sure be nice to have a thumbnail display in addition to the hyperlink.

The code would have to create the thumbnail in addition to listing the files/hyperlinks.

Anyone know a method for doing this? Searched to no avail.

Thanks all,
 
you'll need a thumbnail componant, there are a couple free ones out there but it will slow the page down real bad because it actualy creates a new image and saves it to the hard drive, then the image you show will actualy link to a temp location that you set up.

another way to do it would be to just look to see if it is an image. if it is, use the image tag to show the full image, just give it a set height and width. this will be a long download time and make the images look funny if they are not proportioned right.

If you don't ask the right questions, you don't get the right answers. A question asked in the right way often points to its own answer. Asking questions is the ABC of diagnosis. Only the inquiring mind solves problems.

-Quote by Edward Hodnett
 
Thanks as always for the input. I can batch thumbnails quickly with Fireworks. I'll just do that and display those images.

 
how are you going to match the thumbs up with the files?


If you don't ask the right questions, you don't get the right answers. A question asked in the right way often points to its own answer. Asking questions is the ABC of diagnosis. Only the inquiring mind solves problems.

-Quote by Edward Hodnett
 
I'll use some standard naming convention and a series of IF/Else statements to develop the logic. Haven't worked it through yet but I'll post the code if you want it.

You could probably then cut the code in half for me lol
 
I need a break so i'll muddle through this to help you out.

Store all of your thumbnails in a "thumbs" folder, so you can keep them the same name.

You're already using cfdirectory to get the list of files, so it would be very little extra code.

if the file ends in jpg, jpeg, gif, png, bmp use fileexists to check the thumbs folder for a thumbnail of the same name. if there is just use <img src = "thumbs/#yourDirectoryquery.name#> to display the image.

easy enough. :)





If you don't ask the right questions, you don't get the right answers. A question asked in the right way often points to its own answer. Asking questions is the ABC of diagnosis. Only the inquiring mind solves problems.

-Quote by Edward Hodnett
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top