Re: Gnome and MIME types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the tips.

What I ultiamtely ended up finding was that www-data's home dir is / var/www/. I made a writeable directory called .gnome2 in there and then the command worked. I then made that directory read-only and the command still works.

For whatever it is worth (in case I'm making things way too complicated) I'm looking for a way to have people in my department be able to import pictures, movies, word docs, powerpoints, etc using a common interface. I'd like to use the MIMe types for two things: 1 - to limit what gets imported, and two to have filters work on each file to create thumbnails (I'll be using OOo to create a PDF from the Word/Excel/PPT files).

I tried fileinfo, but couldn't get it to work consistently. The gnomevfs-info command provided very good MIME data, but needed this directory to work. I'm not sure if I can change the home dir in /etc/ password and not have any other ill effects, but I don't think it matter much at this point.

Thanks again for all the help,

nate

On Apr 1, 2007, at 1:48 AM, Richard Lynch wrote:

exec takes a couple optional args to get your error code and output.

Use them.

Then use perror on the command line to see what error code means.

Or I guess you could install my perror extension, if you were bored:
http://l-i-e.com/perror

All that said, I'm not at all sure why you are trying to do what you
are doing, so can't really guess the best way to do it.

Where do the files come from?

Why do you want to guess their mime type?
PHP can't do much useful with a mime type of an MS Office Document
anyway...  Unless you are running PHP on Windows, and want to use
http://php.net/com to open up the document...

On Thu, March 29, 2007 2:29 pm, Nathan Ziarek wrote:
I'm having a hard time getting solid MIME Types of various files.

On my Ubuntu/Apache2/PHP5 system, I first attempted to install
fileInfo. That didn't go so well (on Safari even running "$finfo =
finfo_open(FILEINFO_MIME);" causes it to complain that it lost the
network connection; Firefox prompts me to download the file_ and
seeing as it is not really ready for release, I thought I should stay
away from that.

I then tried running "system("file -i -m /usr/share/docs/mim file")"
which worked, but file doens't provide very good mime types -- all
Microsoft Office Documents returned nothing, for example.

I then stumbled upon gnomevfs-info that provided the information I
wanted. I don't know what mime database it is using (couldn't find it)
but it sure seemed more complete than anything else I had used.

Problem is, I can't seem to run it from within a PHP script (system,
exec, etc). I used the full path (/usr/bin/gnamevfs-info) so I don't
believe that to be the problem, and the page has no errors (I am using
error_reporting(E_ALL)).

Any tips or suggestions?

Thanks!

Nate

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux