// Verify file is available
$path = '';
$size = 0;
if ($file['subdir'] == '') {
$size = strlen($file['attachment']);
} else {
$path = $SETTINGS['files_storage_path'];
if (substr($path, -1) != '/') {
$path .= '/';
}
$path = $path.$file['subdir'].'/'.$file['aid'];
if (!is_file($path)) {
header('HTTP/1.0 500 Internal Server Error');
error($lang['filecorrupt']);
}
$size = intval(filesize($path));
}
if ($size != $file['filesize']) {
header('HTTP/1.0 500 Internal Server Error');
error($lang['filecorrupt']);
}
|