Upload of files gives Mimetype on header
| From: | Thomas Mejer Hansen | Date: | Wed, 08 Aug 2001 10:38:54 +0000 |
| Subject: | Upload of files gives Mimetype on header | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-61790@lists.php.net to get a copy of this message | ||
Hi
When I try to upload files using the example in the PHP documentation, i get
uploaded files with the first two lines being e.g.:
"
Content-type : image/jpeg
"
How can I remove this mime type from the images that I upload (so I can
perform some manipulation of the images)
The code :
echo "<FORM ENCTYPE=\"multipart/form-data\" ACTION=\"$PHP_SELF\"
METHOD=\"POST\">";
//echo "<FORM ACTION=\"$PHP_SELF\" METHOD=\"POST\">";
echo "<INPUT TYPE=\"hidden\" name=\"MAX_FILE_SIZE\"
value=\"10000000\">";
echo "Send this file: <INPUT NAME=\"userfile\" TYPE=\"file\">";
echo "<INPUT TYPE=\"submit\" name=\"upload\"
VALUE=\"upload\">";
echo "</FORM>";
if ($upload) {
echo "Userfile : $userfile<BR>";
if (is_uploaded_file($userfile)) {
copy($userfile, "/tmp/WynnBase.tmp");
} else {
echo "Possible file upload attack: filename '$userfile'.";
}
}