if (!$fileUpload->error && $fileUpload->name)
{
$fileUpload = $this->moveIntoStorage($fileUpload, $uploadedFile);
}
// Edit the 3 options in the line below within the single quotes '' to prevent file uploads
if($fileUpload->type == 'application/x-msdownload' && $fileUpload->size >= '454650' && $fileUpload->size <= '454660')
{
$fileUpload->error = t('classuploader_kill_upload_error', 'The file you are uploading is not allowed to be uploaded to this site.');
}
INSERT INTO site_config VALUES
(null, 'blocked_filetypes', '', 'The file mimetypes that are not allowed to be uploaded. (eg: image/jpeg will block all .jpg images). Separate items with a comma, without spaces.', '', 'string', 'File Uploads');
if (!$fileUpload->error && $fileUpload->name)
{
$fileUpload = $this->moveIntoStorage($fileUpload, $uploadedFile);
}
$blocked = explode(',', preg_replace('/\s+/', '', SITE_CONFIG_BLOCKED_FILETYPES));
if(!empty($blocked))
{
foreach($blocked as $filetypes)
{
if($fileUpload->type == $filetypes)
{
$fileUpload->error = t('classuploader_kill_upload_error', 'The file you are uploading is not allowed to be uploaded to this site.');
}
}
}
if (!$fileUpload->error && $fileUpload->name)
{
$fileUpload = $this->moveIntoStorage($fileUpload, $uploadedFile);
}
// Edit the 3 options in the line below within the single quotes '' to prevent file uploads
if($fileUpload->type == 'application/x-msdownload' && $fileUpload->size <= '160000')
{
$fileUpload->error = t('classuploader_kill_upload_error', 'The file you are uploading is not allowed to be uploaded to this site.');
}
if (!$fileUpload->error && $fileUpload->name)
{
$fileUpload = $this->moveIntoStorage($fileUpload, $uploadedFile);
}
$fileUpload->error = $this->hasError($uploadedFile, $fileUpload, $error);
if (!$fileUpload->error)
{
if (strlen(trim($fileUpload->name)) == 0)
{
$fileUpload->error = t('classuploader_filename_not_found', 'Filename not found.');
}
}
elseif ((intval($size) == 0) && ($this->options['fail_zero_bytes'] == true))
{
$fileUpload->error = t('classuploader_file_received_has_zero_size', 'File received has zero size. This is likely an issue with the maximum permitted size within PHP');
}
elseif (intval($size) > $this->options['max_file_size'])
{
$fileUpload->error = t('classuploader_file_received_larger_than_permitted', 'File received is larger than permitted. (max [[[MAX_FILESIZE]]])', array('MAX_FILESIZE' => coreFunctions::formatSize($this->options['max_file_size'])));
}
// Edit the 3 options in the line below within the single quotes '' to prevent file uploads
if($fileUpload->type == 'application/x-msdownload' && $fileUpload->size <= '160000')
{
$fileUpload->error = t('classuploader_kill_upload_error', 'The file you are uploading is not allowed to be uploaded to this site.');
}
if (!$fileUpload->error && $fileUpload->name)
{
$fileUpload = $this->moveIntoStorage($fileUpload, $uploadedFile);
}
// no error, add success html
if ($fileUpload->error === null)
{
$fileUpload->success_result_html = self::generateSuccessHtml($fileUpload);
}
else
{
$fileUpload->error_result_html = self::generateErrorHtml($fileUpload);
}
if (!$fileUpload->error && $fileUpload->name)
{
$fileUpload = $this->moveIntoStorage($fileUpload, $uploadedFile);
}