HylaFAX The world's
most advanced open source fax server
|
|
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
Re: [hylafax-users] Attachments sent from outlook not displaying
On Thursday 15 June 2006 11:19, Neil Doody wrote:
> I was looking at filename extension, only $1 represents the filename of a
> temporary file generated by faxmail that contains the extracted data to be
> converted. I am in the process of looking for an application which can
> decode files and detect there file type, any ideas?
There's the `file` command; try `man file`. Quick summary:
$ file foo
displays something like
foo: PostScript document text
There are a few options you can use. If you use -i then it will return a
machine-readable MIME type rather than a human-readable explanation; if you
use -b then it will omit the filename from the output.
$ file -bi foo
displays something like
application/postscript
Note that the default behaviour is to treat symbolic links as a file type in
their own right; but if you use -L, then it will follow a symlink and report
the type of the actual file.
You might use something like
MIMETYPE=`file -Lbi $FILENAME`
in a shell script, to get the MIME type of a file.
--
AJS
____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
*To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*