|
To rename upload files based on ID field use the following
code in Add
page: Before record added and/or Edit page: Before record updated
events.
Note: Change the values listed in
red to match your specific needs.
global $files_move;
foreach( $files_move as $key=>$val)
{
if($val[0]==$_FILES["file_FieldName"]["tmp_name"])
$files_move[$key][1] = "files_folder/".$values["ID"].".jpg";
}
$values["FieldName"] = $values["ID"].".jpg";
|
In this example FieldName and ID are actual field names,
files_folder is the
directory where the files will be stored.
|