Fixed sql-bug in upload.php