this is the current code
$att_array = array();
foreach($_FILES as $key => $file) {
$folderid = 'test/';
$imagefolder = DIR_FS_UPLOADS;
$folderPath = $imagefolder . $folderid;
if (zen_not_null($_FILES[$key]['tmp_name'])) {
$exist = is_dir($folderPath);
if(!$exist) {
mkdir("$folderPath");
chmod("$folderPath", 0755);
}
if ($upload = new upload($key, $folderPath)) {
$att_array[] = array('file' => $upload->destination . $upload->filename, 'name' => $upload->filename);
}
}
}
is this right to modify the name, obviously i would need to define $filename
$att_array = array();
foreach($_FILES as $key => $file) {
$folderid = 'test/';
$imagefolder = DIR_FS_UPLOADS;
$folderPath = $imagefolder . $folderid;
if (zen_not_null($_FILES[$key]['tmp_name'])) {
$exist = is_dir($folderPath);
if(!$exist) {
mkdir("$folderPath");
chmod("$folderPath", 0755);
}
if ( $upload = new upload;
$upload->set_file = $key;
$upload->set_destination=DIR_FS_UPLOADS;
if ($upload->parse() == true) {
$upload->set_filename($filename);
$upload->save();
} else {
//die('could not manage uploads');
}) {
$att_array[] = array('file' => $upload->destination . $upload->filename, 'name' => $upload->filename);
}
}
}