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:
<?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:

<?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