Can you run some script before the uploading of a file starts in php? Example, I'm POSTing to upload.php, and in that file I want to check their $_SESSION first before I start wasting bandwidth on them and the file stats uploading to my server. I'm using php 5.2.11 on nginx.
<?php
if ($_SESSION['admin'] == 'YES') {
// do upload here
} else {
exit;
}
?>