OrganizedChaos
MIS
Currently, I am using the following to test an upload page I am building.
I can sucessfully upload .zip, jpg etc files, but havent been able to allow .exe files...
Do I need to add something to allow .exe uploads?
This page is going to be in a protected area that I will be using to upload basic programs that I need when I am out at customers sites, once uploaded I will store their link in a mysql db and post it on a html page.
Code:
<form enctype="multipart/form-data" action="test.php" method="post">
<div align="center">
<p>
Upload</p>
<p><input name="userfile" type="file" /><br />
<input type="submit" value="Upload" />
</p>
</div>
</form>
<?php
$uploaddir = '/var/[URL unfurl="true"]www/website/uploaddir/';[/URL]
$uploadfile = $uploaddir . $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "The file ". basename( $_FILES['userfile']['name']). " has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
?>
I can sucessfully upload .zip, jpg etc files, but havent been able to allow .exe files...
Do I need to add something to allow .exe uploads?
This page is going to be in a protected area that I will be using to upload basic programs that I need when I am out at customers sites, once uploaded I will store their link in a mysql db and post it on a html page.