§Hi all.
How would it be possible to upload a file in a folder build as:
DS.$formname.DS.$selectedinputfield.DS.$filename
where the variable "selectedinputfield" is the name of an input field in the form.
Basically, according to the choice, the system will store images in a proper subfolder in upload>nameform>images
I am looking at: chronocontact.php
Many thanks!
How would it be possible to upload a file in a folder build as:
DS.$formname.DS.$selectedinputfield.DS.$filename
where the variable "selectedinputfield" is the name of an input field in the form.
Basically, according to the choice, the system will store images in a proper subfolder in upload>nameform>images
I am looking at: chronocontact.php
if ( $fileok ) {
$uploadedfile = JFile::upload($original_name, JPATH_COMPONENT.DS.'uploads'.DS.$formname.DS.$category_1.DS.$filename);//handle_uploaded_files($original_name, $filename);
$posted[$allowed_s2[0]] = $filename;
JRequest::setVar($allowed_s2[0], $filename);
if ( $uploadedfile ) {
$attachments[$allowed_s2[0]] = JPATH_COMPONENT.DS.'uploads'.DS.$formname.DS.$filename;
if ( $debug ) {
$mainframe->enqueueMessage($filename.' has been uploaded OK');
}
}else{
if ( $debug ) {
$mainframe->enqueueMessage($filename.' has NOT been uploaded!!');
}
}
}
Many thanks!