Selecting Specific Upload from List
3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 24, 2008 (RSS)
By InHouse - April 24, 2008
In one Section Editor I have to have more than one uploaded file. One is a JPG and the other is a PDF. I've allowed the PDF type upload, JPG thumbnailing, and everything is working well.
I'd like some ideas of how I can manage the output better than I am currently. I'm showing a thumbnail of the JPG (no problem) and then want to also have a link to the PDF for immediate download.
Right now the PDF download link looks like:
But $upload['urlPath']is returning the URL for the first upload in the list. In this case it's the JPG. I'd like to sniff for a .PDF file type ideally. Is that possible?
Jayme
I'd like some ideas of how I can manage the output better than I am currently. I'm showing a thumbnail of the JPG (no problem) and then want to also have a link to the PDF for immediate download.
Right now the PDF download link looks like:
<?php if ($upload['isImage'] = FALSE ): ?>
<a href="<?php echo $upload['urlPath'] ?>">Download PDF</a>
But $upload['urlPath']is returning the URL for the first upload in the list. In this case it's the JPG. I'd like to sniff for a .PDF file type ideally. Is that possible?
Jayme
Re: [InHouse] Selecting Specific Upload from List
By Dave - April 24, 2008
No problem. We can make it work just about any way you could imagine with just a little bit of code. Try this:
The ! means "not" as in "not image". Let me know if that does the trick or if you need something more.
<?php if (!$upload['isImage']): ?>
<a href="<?php echo $upload['urlPath'] ?>">Download PDF</a>
...
The ! means "not" as in "not image". Let me know if that does the trick or if you need something more.
Dave Edis - Senior Developer
interactivetools.com
interactivetools.com
Re: [Dave] Selecting Specific Upload from List
By InHouse - April 24, 2008
Hi Dave,
Yeah, I tried that but it didn't work as expected. I probably should have mentioned that this is being done in conjunction with the photo gallery code mentioned in:
http://www.interactivetools.com/forum/gforum.cgi?post=59842#59842
I'll PM you the files as they now include a series of ... well... includes.
J.
Yeah, I tried that but it didn't work as expected. I probably should have mentioned that this is being done in conjunction with the photo gallery code mentioned in:
http://www.interactivetools.com/forum/gforum.cgi?post=59842#59842
I'll PM you the files as they now include a series of ... well... includes.
J.