It's possible to show an image after upload. but it's not easy, because it is not a standard functionality in RSForms. You need to create a new form, in this new form you need to add some custom html in a free text box.
for example:
its possible to wrap this into the lightbox code.
In the image.php you need to use an SQL SELECT statement to fetch the submitted row. After you fetched the submitted row you are able to select the file, the filename code needs to be processed and checked on extension type. after that you are able to use the GD PHP library to render the image back into your lightbox. You need to have the GD library enabled in the PHP.ini or by your hosting provider if it isn't enabled. this way you are also able to perform transformations onto the image such as scaling or drawing lines etc. I use this way to render a rendered page for printing several images at once.
a little example:
define('_JEXEC', 1);
define('DS', DIRECTORY_SEPARATOR);
if (file_exists(dirname(__FILE__) . '/defines.php')) {
include_once dirname(__FILE__) . '/defines.php';
}
if (!defined('_JDEFINES')) {
define('JPATH_BASE', dirname(__FILE__));
require_once JPATH_BASE.'/includes/defines.php';
}
require_once JPATH_BASE.'/includes/framework.php';
$mainframe = &JFactory::getApplication('site');
$imageRecId = $mainframe->getUserState('<imageRecord>');
$db =& JFactory::getDBO();
if($imageRecId ){
$db->setQuery("SELECT file1 FROM #__<ADATABASETABLE> WHERE id='".$imageRecId."';");
}
$result = $db->loadObjectlist();
$file = "<somepathtoFile>".getFileName($result[0]->file1);
function getFileName($file){
// performing regex
$do = preg_match("/>(.*)<\/a>/", $file, $matches);
// Check if regex was successful
if ($do = true) {
// Matched something, show the matched string
// echo htmlentities($matches['0']);
// Also how the text in between the tags
// echo '<br />' . $matches['1'];
$file=$matches['1'];
} else {
// No Match
// echo "Couldn't find a match";
}
return $file;
}
function getFileName($file){
// performing regex
$do = preg_match("/>(.*)<\/a>/", $file, $matches);
// Check if regex was successful
if ($do = true) {
// Matched something, show the matched string
// echo htmlentities($matches['0']);
// Also how the text in between the tags
// echo '<br />' . $matches['1'];
$file=$matches['1'];
} else {
// No Match
// echo "Couldn't find a match";
}
return $file;
}
header('Content-Type: image/png');
$im = ImageCreateTrueColor($width,$height);
$im = imageArray($im);
imagepng($im);
imagedestroy($im);
function imageArray($im,$imgUrl,$imgType){
if($imgType == "bmp"){
$image = imagecreatefromwbmp($imgUrl);
}
if($imgType == "gif"){
$image = imagecreatefromgif($imgUrl);
}
if($imgType == "png"){
$image = imagecreatefrompng($imgUrl);
}
if(($imgType == "jpg") || ($imgType == "jpeg")){
$image = imagecreatefromjpeg($imgUrl);
}
$imageSize = getimagesize($imgUrl);
$imageWidth = $imageSize[0];
$imageHeight = $imageSize[1];
$sizeWidth = $imageSize[0]; //possibility to scale image down.
$sizeHeight = $imageSize[1]; //possibility to scale image down.
$xcoor = 0;
ycoor = 0;
imagecopyresampled($im, $image,$xcoor, $ycoor, 0, 0,$sizeWidth,$sizeHeight,$imageWidth,$imageHeight);
return $im;
}
ImageAntiAlias($im, true);
You need to place the php code in a file named image.php. This file needs to be uploaded to the joomla site. in my example it must be placed on the root.