FIXED
I was getting an error value of 2
.
This is the PHP upload script that I am using. Users are allowed to upload files with no restrictions. However, some .exe files fail to get uploaded while others work fine. I'm not sure what the problem is? (This script was taken from a PHP tutorial)
<?php
// Where the file is going to be placed
$target_path = "uploads/";
/* Add the original filename to our target path.
Result is "uploads/filename.extension" */
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
$target_path = "uploads/upload.exe";
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
echo '<br/>';
echo '<br/>';
echo '<a href="http://localhost/Test/uploads/run.php">Continue</a>';
} else{
echo "There was an error uploading the file, please try again!";
}
?>