note 109223 added to features.file-upload
| From: | Anonymous | Date: | Wed, 27 Jun 2012 11:20:16 +0000 |
| Subject: | note 109223 added to features.file-upload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188916@lists.php.net to get a copy of this message | ||
Restrictions on Upload
In this script we add some restrictions to the file upload. The user may only upload .gif or .jpeg
files
First Program:
<body>
<form name="file" action="uploadimag.php" method="post"
enctype="multipart/form-data">
<input type="file" name="file" value="" />
<input type="submit" value="upload" name="upload" />
</form>
</body>
</html>
Second Program:
<?php
if (($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg"))
{
echo "Image Upload";
}
else
{
echo "please only Image Upload";
}
?>
----
Server IP: 59.162.86.123
Probable Submitter: 49.213.35.167
----
Manual Page -- http://www.php.net/manual/en/features.file-upload.php
Edit -- https://master.php.net/note/edit/109223
Del: integrated -- https://master.php.net/note/delete/109223/integrated
Del: useless -- https://master.php.net/note/delete/109223/useless
Del: bad code -- https://master.php.net/note/delete/109223/bad+code
Del: spam -- https://master.php.net/note/delete/109223/spam
Del: non-english -- https://master.php.net/note/delete/109223/non-english
Del: in docs -- https://master.php.net/note/delete/109223/in+docs
Del: other reasons-- https://master.php.net/note/delete/109223
Reject -- https://master.php.net/note/reject/109223
Search -- https://master.php.net/manage/user-notes.php