Mercurial > hg > aimc
comparison trunk/scripts/aim-o-matic/aim-o-matic.php @ 520:2e53a3b92525
AIM-o-matic scripts for automated running of AIM on a server.
author | tom@acousticscale.org |
---|---|
date | Wed, 22 Feb 2012 14:03:43 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
519:0518da52cb35 | 520:2e53a3b92525 |
---|---|
1 <?php | |
2 if ($_FILES["audio_file"]["size"] < 20000000 && $_FILES["config_file"]["size"] < 2000000) { | |
3 if ($_FILES["audio_file"]["error"] > 0 || $_FILES["config_file"]["error"]) { | |
4 echo "error: file upload failed"; | |
5 } else { | |
6 $id_string = uniqid("aim-o-matic", true); | |
7 $ext = pathinfo($_FILES["audio_file"]["name"], PATHINFO_EXTENSION); | |
8 move_uploaded_file($_FILES["audio_file"]["tmp_name"], "/home/ubuntu/upload/" . $id_string . "." . $ext); | |
9 move_uploaded_file($_FILES["config_file"]["tmp_name"], "/home/ubuntu/upload/" . $id_string . ".config"); | |
10 echo "Results will be avaiable shortly, here:<br>"; | |
11 echo "<a href='results/" . $id_string . "/'>" . $id_string . "</a>"; | |
12 } | |
13 } else { | |
14 echo "error: file too large"; | |
15 } | |
16 | |
17 ?> |