Hey Tom....I have worked on this prior and instead of using
{File:1}
use
{:1} or whatever the upload field was set to inside of a HTML field
Next the default display of the uploaded file doesn't display as a direct url but rather a link.
Since you are using David Smiths snippet over here http://gravitywiz.com/2012/08/04/better-pre-submission-confirmation/
modify this portion
$file_path = $value;
if(!empty($file_path)){
$file_path = esc_attr(str_replace(" ", "%20", $file_path));
$value = "<a href='$file_path' target='_blank' title='" . __("Click to view", "gravityforms") . "'>" . $file_info['uploaded_filename'] . "</a>";
}
return $value;
to this
$file_path = $value;
if(!empty($file_path)){
$file_path = esc_attr(str_replace(" ", "%20", $file_path));
$value = "<img src='$file_path' alt='' width='200' />";
}
return $value;
This changes it from a link to a img src reference instead. I added my own width value for my own use but its a decent start if this is what you are looking to do.
Hope that helps!
Posted 12 years ago on Saturday November 17, 2012 |
Permalink