/**
* Upload function will be called via the Flash uploader
*
* @class nggAdmin
* @param integer $galleryID
* @return string $result
*/
function swfupload_image($galleryID = 0) {
global $nggdb;
if ($galleryID == 0)
return __('No gallery selected !', 'nggallery');
// WPMU action
if (nggWPMU::check_quota())
return '0';
// Check the upload
if (!isset($_FILES['Filedata']) || !is_uploaded_file($_FILES['Filedata']['tmp_name']) || $_FILES['Filedata']['error'] != 0)
return __('Invalid upload. Error Code : ', 'nggallery') . $_FILES['Filedata']['error'];
[... snip ...]
$dest_file = WINABSPATH . $gallery->path . '/' . $filename;
// save temp file to gallery
if ( !@move_uploaded_file($_FILES["Filedata"]['tmp_name'], $dest_file) ){
nggAdmin::check_safemode(WINABSPATH . $gallery->path);
return __('Error, the file could not be moved to : ','nggallery'). esc_html( $dest_file );
}
if ( !nggAdmin::chmod($dest_file) )
return __('Error, the file permissions could not be set','nggallery');
return '0';
}