I realize that this is a very basic question. Well, to be honest, I am very new. This is the first time that I have worked with php.
The only thing that I am trying to do is to allow internal users to upload to a file to a temporary directory on the server. Here is the php and form code...
HTML
<form enctype="multipart/form-data" action="uploader.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
PHP
<?php
$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
?>
The "uploads" folder is located in the same directory as the html and php. I have verified permissions on that folder that allow the "users" group to read/write.
This is on IIS 8.5 and Windows Server 2012.
When I run this, choose a file and select "upload," it says "No file specified!"
Thanks in advance for any help and I look forward to any information that you can provide as this is my first post on here.