Hey guys i'm super new to this stuff, was wondering if I could get a little help...
I am trying to upload a file via a form and create a folder "whatever" and then move the file there. Here is my code.
<?php
if (is_uploaded_file($userfile)) {
copy($userfile, "C:\Inetpub\wwwroot\whatever");
} else {
echo "Possible file upload attack: filename '$userfile'.";
}
/ ...or... /
move_uploaded_file($userfile, "C:\Inetpub\wwwroot\whatever");
?>
<FORM ENCTYPE="multipart/form-data" ACTION="upload10.php" METHOD="POST">
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="19000">
Send this file: <INPUT NAME="userfile" TYPE="file">
<INPUT TYPE="submit" VALUE="Send File">
</FORM>
The problem is, instead of creating a folder "whatever" it creates a file "whatever" with no extension, and inside the file is whatever i've uploaded. So if i upload an image, all the image code goes into the file "whatever"
Help please!