***YOU MUST BE AN INTERNAL USER WITH ADMIN AND FORM MANAGEMENT PRIVILEDGES TO COMPLETE THE FOLLOWING STEPS

Note: Before editing a formyou should always use the 'Duplicate' button to create a duplicate of the form, in case you break something by accident. Then, after you are sure your changes have been applied and are working the way you wish them to in front end, you can delete the duplicate form.

 

Login to ADMIN FastGem in the instance you are editing. 

Access the form you are adding this feature to.

Add the following fields: 

  • Hidden Field named ' photo_file_location' (No values needed) 
  •    
  •  

 

      

  • 'File Upload' field named 'Photo'.  Caption should be: 'Your Photo'. Description: 'This photo will be used to verify your identity to prevent any fraudulent activity.' Once you've filled in this information, click on 'Attributes' tab. 
  •              
  •  

 

  • Attributes should be added as shown in picture below.

 

 

  • Go into "Form Properties" > "Php Scripts" and paste the code below in the "Script called after form has been processed" box.  

 

 

 

 

     

 

 

 

Code to paste: 

try{
list($replace, $with) = RSFormProHelper::getReplacements($SubmissionId);
$uploadPath = str_replace($replace, $with, '{photo:path}');
$post['photo_file_location'] = preg_replace("/https:\/\/(.*?).fastgem.net\/tmp\//","",$uploadPath);
$directoryName = JPATH_ROOT . "/assets/submissions/";
if(!is_dir($directoryName)){
//Directory does not exist, so lets create it.
mkdir($directoryName, 0755);
}
rename(JPATH_ROOT . "/tmp/" . $post['photo_file_location'], $directoryName . $post['photo_file_location']);
}catch(Throwable $t){}
 
 
Once you've completed these steps, click 'Save & Close'.
 
 
Go into FastGem > Config > Submission Data and, if it does not already exist in the Person Data Layout List, add the following row with field details as listed below:
 
   
 
 
 
 
 
 
 
   
 
 
    
 
 
 
 
FIELD DETAILS: 
 
 
Click 'Done' Then, 'Save'.