<?php
if (isset($_POST['submited']))
{
if (isset($_FILES['upload']))
{
$allowed=array('image/JPEG','application/x-bittorrrent');
if (in_array($_FILES['upload']['type'],$allowed))
{
if(move_uploaded_file($_FILES['upload']['tmp_name'] , "../upload/$_FILES['upload']['tmp_name']"))
{
echo'Your file has been successfully uploaded!';
}
else
{
echo'Please upload a torrent file!';
}
}
}
if ($_FILES['upload']['error']>0){echo 'An error has occured.';}
if (file_exists ($_FILES['upload']['tmp_name'])
&& is_file( $_FILES['upload']['tmp_name'] ) ){
unlink ($_FILES['upload']['tmp_name'] );
}
}
?>
<html>
<title>Upload</title>
<body>
<form enctype="multipart/form-data" action="upload_torrent.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="50000000"/>
<input type="file" name="upload"/>
<input type="submit" name="submit" value="submit"/>
<input type="hidden" name="submitted" value="TRUE" />
</form>
</body>
</html>
Here is my upload form and php upload script. I am using an example from Visual QuickPro Guide PHP 6 and MySQL 5. I changed it just a little bit to allow torrents. I kept the jepg though to see if it works with regular files. No errors, yet no upload. I don't see anything particularly that sticks out, and I am booting from a zwamp environment. I am also using Windows 8. I edited any errors with the form I believe, but I don't see what could be causing a problem. Thanks!