I'm having the darnest time uploading files to an Apache/PHP server.
- I have test.txt with the following text:
This is a test.
- I have the following code in form 1.
<form action="upload.php" enctype="multipart/form-data" method=post>
<input type="file" name=uploadedfile"><br>
<input type=submit value="Upload File">
</form>
- I have the following code in upload.php:
copy($HTTP_POST_FILES['uploadedfile']['tmp_name'], $HTTP_POST_FILES['uploadedfile']['name']);
When the file is uploaded the following text is appended to the begining of file:
Content-Type: text/plain
So the file now looks like:
Content-Type: text/plain
This is a test.
This happens with EVERY file I attempt to upload, thus, forbidding me to properly upload text or binary files. Binaries such as GIFs, PDFs, etc... are damaged immediately due to the files being appended.
Is there a setting I'm over looking somewhere on the server or PHP code?
Any help is greatly appreciated.
Many thanks,
Anthony