note 79283 added to function.exif-imagetype
| From: | Tim at osu1 dot php dot net | Date: | Mon, 19 Nov 2007 16:40:07 +0000 |
| Subject: | note 79283 added to function.exif-imagetype | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132407@lists.php.net to get a copy of this message | ||
By trial and error, it seems that a file has to be 12 bytes or larger in order to avoid a "Read
error!". Here's a work-around to avoid an error being thrown:
// exif_imagetype throws "Read error!" if file is too small
if (filesize($uploadfile) > 11)
$mimetype = exif_imagetype($uploadfile);
else
$mimetype = false;
----
Server IP: 69.147.83.197
Probable Submitter: 209.112.3.6
----
Manual Page -- http://www.php.net/manual/en/function.exif-imagetype.php
Edit -- https://master.php.net/note/edit/79283
Del: integrated -- https://master.php.net/note/delete/79283/integrated
Del: useless -- https://master.php.net/note/delete/79283/useless
Del: bad code -- https://master.php.net/note/delete/79283/bad+code
Del: spam -- https://master.php.net/note/delete/79283/spam
Del: non-english -- https://master.php.net/note/delete/79283/non-english
Del: in docs -- https://master.php.net/note/delete/79283/in+docs
Del: other reasons-- https://master.php.net/note/delete/79283
Reject -- https://master.php.net/note/reject/79283
Search -- https://master.php.net/manage/user-notes.php