Hello! I am starting in PHPRunner, in PHP in anything. I need help for do it.
How I can change the name of the file that I want upload?
I have a "File" Field. In that field I upload one file. I do it that from Add page.
I want change the name that I upload and store in DDBB
I use this code in Event "Before record added"
____
____
// Parameters:
// $values - Array object.
// Each field on the Add form is represented as a 'Field name'-'Field value' pair
//** ****
foreach($values as $field=>$value)
$message.= $field." : ".$value."
";
echo($message);
//Change the value of the name of the file that I want save
$values ["FILE"] = "XXX.DOC";
// I want to see if the value is changed. And it is changed ok.
foreach($values as $field=>$value)
$message.= $field." : ".$value."
";
echo($message);
return true;
// return true if you like to proceed with adding new record
// return false otherwise
------------------------------------------------------------------------------------------------
But the value save in the DDBB is changed, but the name of the file it is not changed.
In anohter hand if I write another name in the box "Filename" ( in the Add page") then change the name of the field stored and the name stored in the DDBB
I am thinking that there are another variable in HTML and it saves the file with this name. But I don´t know!
How I can change the name of the file that I want upload?
Table Foto
Field1 --> FOTO1 It is a Image field ( VARCHAR (50) )
Field2 --> FICHERO It is a File field ( VARCHAR (50) )
PHPRUNNER 5.0 BUILD 766
Thanks