To do in memory matches I use File::LibMagic on ubuntu box with the latest lib 
magic library installed. 
my $libm = File::LibMagic->new();
my $mtype = $libm->checktype_contents($content);
There is also a method for getting 

Thanks,
------------------------------------------
Ali Mesdaq (CISSP, GIAC-GREM)
Sr. Security Researcher
Websense Security Labs
http://www.WebsenseSecurityLabs.com
------------------------------------------


-----Original Message-----
From: William Wueppelmann [mailto:william.wueppelm...@canadiana.ca] 
Sent: Tuesday, January 19, 2010 6:39 AM
To: The elegant MVC web framework
Subject: Re: [Catalyst] determine MIME type of binary Webservice result?

On 2010-01-19, at 9:21 AM, Jens Schwarz wrote:

> Hi,
> 
> in my Catalyst application I use Webservices to connect to SAP. One of these 
> returns "binary" data (right now base64-encoded XML, later also PDF).
> 
> Is it possible to determine the MIME type of those returned (sub)strings? If 
> so, how?
> 
> Thanks
> 
> Jens
> -- 
> Preisknaller: GMX DSL Flatrate für nur 16,99 Euro/mtl.!
> http://portal.gmx.net/de/go/dsl02
> 
> _______________________________________________
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/

I am using File::MimeInfo::Magic to determine MIME types for uploaded files. I 
haven't tried to use it with in-memory strings as opposed to on-disk files, but 
the docs for File::MimeInfo say that this is doable.

-William
_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


 Protected by Websense Hosted Email Security -- www.websense.com 

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to