note 78841 added to ref.fileinfo
| From: | DanielWalker at ncfe dot org dot uk | Date: | Tue, 30 Oct 2007 16:32:40 +0000 |
| Subject: | note 78841 added to ref.fileinfo | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-131831@lists.php.net to get a copy of this message | ||
Using the Unix 'file' program with the -i switch will not work reliably.
Consider the following plain-text CSV file (we'll call it 'error.csv'), which has the
contents:
GIFT,WRAPPED,ERRORS,ON,LOOKING,At,FILES
...just that one line: nothing above it, nothing below.
Now, what does asking:
file -i error.csv
...give us for this file? Yes, that's right -
'error.csv: image/gif'
Why? Because the first line starts 'GIF...', that's why. You cannot trust file.
----
Server IP: 194.145.210.4
Probable Submitter: 195.97.249.30
----
Manual Page -- http://www.php.net/manual/en/ref.fileinfo.php
Edit -- https://master.php.net/note/edit/78841
Del: integrated -- https://master.php.net/note/delete/78841/integrated
Del: useless -- https://master.php.net/note/delete/78841/useless
Del: bad code -- https://master.php.net/note/delete/78841/bad+code
Del: spam -- https://master.php.net/note/delete/78841/spam
Del: non-english -- https://master.php.net/note/delete/78841/non-english
Del: in docs -- https://master.php.net/note/delete/78841/in+docs
Del: other reasons-- https://master.php.net/note/delete/78841
Reject -- https://master.php.net/note/reject/78841
Search -- https://master.php.net/manage/user-notes.php