Fixed invalid json response format on error in upload.php.