[Typo3-dev] 3.6.0RC1: t3lib_div::upload_copy_move()
Kasper Skårhøj
kasper at typo3.com
Mon Jan 26 21:52:29 CET 2004
Please test for me if this works:
function upload_copy_move($source,$destination) {
if (is_uploaded_file($source)) {
$uploaded = TRUE;
// Return the value of move_uploaded_file, and if false the temporary
$source is still around so the user can use unlink to delete it:
$uploadedResult = move_uploaded_file($source, $destination);
} else {
$uploaded = FALSE;
@copy($source,$destination);
}
// Setting file system mode of file:
if (@is_file($destination) && TYPO3_OS!='WIN') {
@chmod ($destination,
octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['fileCreateMask']));
}
// If here the file is copied and the temporary $source is still
around, so when returning false the user can try unlink to delete the
$source
return $uploaded ? $uploadedResult : FALSE;
}
Report directly to my email whether it did. I didn't test it an trust you!
- kasper
More information about the TYPO3-dev
mailing list