Hi
I'm trying to get the code for inserting the URL of the uploaded file into the mail to work.
I changed [file_1] ---> [file_5]
I inserted the code (the one from book) within the 'On Submit code - before...' box
In the mail template I have {file_5}. But the only thing I get in the mail (+debug) is the file name (with date) and the extension of the file (.jpg)
The deeper purpose of this is to get the URL inserted into SugarCRM
Can someone explain if I am missing something😟 ?
I use Chronoforms 3.1 RC5.5 and Joomla 1.5.23
I'm trying to get the code for inserting the URL of the uploaded file into the mail to work.
I changed [file_1] ---> [file_5]
I inserted the code (the one from book) within the 'On Submit code - before...' box
<?php
// get the form uploads information
$MyUploads =& CFUploads::getInstance($MyForm->formrow->id);
// extract the file path
$file_path = $MyUploads->attachments[file_5];
// remove the 'root folder' from the beginning
$file_url = substr($file_path, strlen(JPATH_SITE)+1);
//correct any mis-directed separators
$file_url = str_replace(DS, '/', $file_url);
// add the domain name to the beginning
$file_url = JURI::base().$file_url;
// save the URL into the form results
JRequest::setVar('file_url', $file_url);
?>
In the mail template I have {file_5}. But the only thing I get in the mail (+debug) is the file name (with date) and the extension of the file (.jpg)
The deeper purpose of this is to get the URL inserted into SugarCRM
Can someone explain if I am missing something😟 ?
I use Chronoforms 3.1 RC5.5 and Joomla 1.5.23