File Uploads - Filter file types

4 posts by 3 authors in: Forums > CMS Builder
Last Post: December 27, 2011   (RSS)

By gversion - December 24, 2011

Hello,

On my website users can upload files to their listings. Files can be images (e.g. GIF/JPG) and documents (e.g. PDF/DOC).

The uploaded images are being displayed neatly in a photo gallery lightbox.

Is there a way I can display a bullet point list of only the PDF or DOC(X) files that have been uploaded?

Thank you,
Greg

Re: [gversion] File Uploads - Filter file types

By robin - December 27, 2011

Hey Greg,

The code generator creates a true/false value ($upload['isImage']) you can use to test images:

<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>

<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>


Hope that helps,
Robin
Robin
Programmer
interactivetools.com

Re: [robin] File Uploads - Filter file types

By gversion - December 27, 2011

Hi guys,

Many thanks for helping me out.

Kind regards,
Greg