$object->setDate($date / 1000); // proceed for $attachment $files = explode("\n", trim($attachment)); $rtn = array(); foreach ($files as $file) { $file = trim($file); // for cache file, we move it to its proper location if (strpos($file, str_replace(WEBROOT . DS, "", CACHE_DIR)) === 0) { $oldname = WEBROOT . DS . $file; $newname = WEBROOT . DS . "files/plupfiletest" . str_replace(CACHE_DIR, "", WEBROOT . DS . $file); rename($oldname, $newname); $file = str_replace(WEBROOT . DS, "", $newname); } $rtn[] = $file; } $object->setAttachment(implode("\n", $rtn)); // proceed for $application $files = explode("\n", trim($application)); $rtn = array(); foreach ($files as $file) { $file = trim($file); // for cache file, we move it to its proper location if (strpos($file, str_replace(WEBROOT . DS, "", CACHE_DIR)) === 0) { $oldname = WEBROOT . DS . $file; $newname = WEBROOT . DS . "files/plupfiletest" . str_replace(CACHE_DIR, "", WEBROOT . DS . $file); rename($oldname, $newname); $file = str_replace(WEBROOT . DS, "", $newname); } $rtn[] = $file; } $object->setApplication(implode("\n", $rtn));