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

Re: Using or working around File::MMagic under mod_perl


Hi Mark,

What's interesting is that the same version of File::MMagic works
correctly on a different machine. I suspect that some other module
loaded has changed a global variable that File::MMagic depends on.

Someone has a bug report and patch to that effect here:
http://rt.cpan.org/Public/Bug/Display.html?id=11121

Hmm, if someone is changing $/ without localizing it in a persistent
interpreter like mod_perl or FastCGI, it's pretty much guaranteed to
break something.  I don't think File::MMagic should be expected to
defend against that kind of insanity.

File::MMagic is used by Data::FormValidator's "file_format" constraint
for file uploads, so some other people may be using indirectly under
mod_perl as well.

Under mod_perl, it is possible to get this from apache without using
File::MMagic, by using a subrequest.  There's some more discussion
here:
http://modperl.com/book/chapters/ch8.html#Reimplementing_I_mod_mime_in_Pe

Could it simply be a matter of fixing the use of the DATA handle, as
Stats suggest here?

Yes, very likely.

- Perrin


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.