Skip to content
Snippets Groups Projects
Commit 9676dc23 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

Check file size of uploaded data

This will abort the upload process when the uploaded temp file has zero bytes.
This can occur when the disk is full.

darcs-hash:20080715215345-7ad00-1a2b45b77d59b1b39d0133ec1737dbb0054368c1.gz
parent 24297a69
No related branches found
No related tags found
No related merge requests found
......@@ -215,6 +215,12 @@ function media_upload($ns,$auth){
$file = $_FILES['upload'];
if(empty($id)) $id = $file['name'];
// check for data
if(!@filesize($file['tmp_name'])){
msg('No data uploaded. Disk full?',-1);
return false;
}
// check extensions
list($fext,$fmime) = mimetype($file['name']);
list($iext,$imime) = mimetype($id);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment