File Uploads - Filter file types

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

Re: [gversion] File Uploads - Filter file types

By northernpenguin - December 26, 2011

Hi Greg

Well, it really depends on how you wrote your code, but if you use the basic code from code generator you will notice the "if statement".

The if statement first displays thumbnails based on certain conditions, else the full image, and if a document, a link for download.

By using this basic structure, you should be able to build your own filter system.

You can also check The CMSB Cookbook for additional information (http://www.thecmsbcookbook.com).

Happy Holiday!
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke

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