Jens Schwarz wrote:
> 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?

It doesn't matter that you're using Catalyst for this problem.

Your first question should be whether SAP actually returns the data/MIME 
type as part of it's response to your request. If so crib it from there.

If not, you could save the binary data to a file and run some form of 
file-type/magic number detection. If you're running in a unix environment 
you might find the "file" command useful for this.

Carl


_______________________________________________
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