displaying file uploads

2 posts by 2 authors in: Forums > CMS Builder
Last Post: June 7, 2010   (RSS)

Re: [paulmac] displaying file uploads

By Jason - June 7, 2010

Hi,

Assuming that pdf's are the only files being uploaded to the brochure field, you can use this code:

<!-- STEP 2a: Display Uploads for field 'brochure' (Paste this anywhere inside STEP2 to display uploads) -->
<!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
<?php if($test_uploadRecord['brochure']):?>
<h2>Brochures</h2>
<?php foreach ($test_uploadRecord['brochure'] as $upload): ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>
<?php endforeach ?>
<?php endif ?>
<!-- STEP2a: /Display Uploads -->


You can replace the code: <h2>Brochures</h2> with whatever title you want. This will only display if there are files that have been uploaded to the "brochure" field.

Give that a try and let me know if you run into any issues.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/