ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Mime-type from filename?

Post new topic  Reply to topic
 Mime-type from filename? « View previous topic :: View next topic » 
Author Message
marko.pitkanen
PostPosted: Thu Nov 29, 2012 7:52 am    Post subject: Mime-type from filename? Reply with quote

Chevalier

Joined: 23 Jul 2008
Posts: 440
Location: Jamsa, Finland

Hi,

Broker version 7.0.0.4.

I need to implement interface where message flow posts data to external web application packing it into multipart/form-data. One part contains mime classified content and I need to define Content-Type from original filename.

What are good ways to find out Content-Type from filename?

I have searched only a bit from InfoCenter if broker can do it for me with built-in functionalities but found no positive answer.

I have tested that I can build Java wrapper around javax.activation.MimetypesFileTypeMap which then can be directed with mime.types -file.

I think I can implement also a database look-up for this conversion.

I'm asking your opinions and thoughts which way I should implement this to achieve solution that is align to product, maintainable and performs well.

--
Marko
Back to top
View user's profile Send private message Visit poster's website
mqjeff
PostPosted: Thu Nov 29, 2012 7:59 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

For this kind of thing, my preference is always to lean towards the thing that I don't have to actually maintain the contents of the lookup table.

So I'd either look for something like a well-published external website I can query, or I'd use the javax.activation file type map.

Unless you know that you have a very limited set of potential file types and a very limited set of file extensions? That is, if you know you're only ever attaching text files or JPG files, so you only need to decide between two things? Then I'd hard code it. If it's a relatively small set (like 10), then I might put them into UserDefinedProperties... but again there's a question of how much maintenance effort is that going to take. (How often will you need to add new types...)

Using a database for this is going to be more effort to maintain and likely take more time to query.
Back to top
View user's profile Send private message
marko.pitkanen
PostPosted: Mon Dec 03, 2012 3:04 am    Post subject: Reply with quote

Chevalier

Joined: 23 Jul 2008
Posts: 440
Location: Jamsa, Finland

Thanks mqjeff,

Because this interface is for ECM, potential file-type space is wide and I decided to use javax.activation file type map through home made Java wrapper via external procedure from ESQL.

--
Marko
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Mime-type from filename?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.