This is great for ASCII, but do you know how to get more information from an "application/octet-stream" result?
| Carsten Hammer <[EMAIL PROTECTED]>
10/27/2005 04:02 PM |
|
Hi Dan,
if you want to keep with standard apis then you should try to use
String mimetype=new FileDataSource(filename).getContentType();
See the examples coming with JavaBeans(TM) Activation Framework for how
to use it.
Best regards,
Carsten
Dan McKeon wrote:
>
> Our extensions reflect the business process rather than the file type.
> For example, everything we scan is TIFF, but they may have a IIX, SCN,
> PSM, etc extension. We have database codes associated with the files
> that I can use to tell me what format it is, but I was looking for
> something more generic, whether the file is registered with our system
> or not.
>
>
>
>
> "Bill Ensley" <[EMAIL PROTECTED]>
>
> 10/25/2005 03:02 PM
>
>
> To
> "'Dan McKeon'" <[EMAIL PROTECTED]>, "iText Mail Group"
> <[email protected]>
> cc
>
> Subject
> RE: [iText-questions] Image Type Detection
>
>
>
>
>
>
>
>
> Just check the extension.
>
> .txt
> .doc
> .jpg
>
> etc
>
> Bill Ensley
> Bear Printing
>
> ------------------------------------------------------------------------
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Dan McKeon
> Sent: Tuesday, October 25, 2005 12:32 PM
> To: Bruno Lowagie
> Cc: [email protected]
> Subject: Re: [iText-questions] Image Type Detection
>
>
> I just wasn't sure if iText could tell me if my input file is ASCII or
> PCL. I figured out how to detect PDF. I invoke PdfReader and if it
> throws an exception, I know it's not PDF. Is there anything like that
> for ASCII or PCL?
>
>
>
> Bruno Lowagie <[EMAIL PROTECTED]>
>
> 10/25/2005 01:26 PM
>
>
> To
> Dan McKeon <[EMAIL PROTECTED]>
> cc
> [email protected]
> Subject
> Re: [iText-questions] Image Type Detection
>
>
>
>
>
>
>
>
>
>
> Dan McKeon wrote:
>
> >
> > I am a programmer on an Image Team. The documents in our system are
> > TIFF, JPEG, ASCII, PCL, PDF. I wanted to code a web service that
> > could detect what was being input and just always output a PDF.
>
> That I can understand. You want to write some software that can detect
> the format of a file.
> What I didn't understand is why you would want to stuff that in the
> Image class.
> I'm still not sure if your mail contains a question or an intention.
> br,
> Bruno
>
>
>
>
> ****
> This message may contain confidential information intended only for the
> use of the
> addressee(s) named above and may contain information that is legally
> privileged.
> If you are not the addressee, or the person responsible for delivering
> it to the
> addressee, you are hereby notified that reading, disseminating,
> distributing or
> copying this message is strictly prohibited. If you have received this
> message
> by mistake, please immediately notify us by replying to the message and
> delete
> the original message immediately thereafter. Thank you.
> ****
>
>
>
>
>
>
> ****
> This message may contain confidential information intended only for the use of the
> addressee(s) named above and may contain information that is legally privileged.
> If you are not the addressee, or the person responsible for delivering it to the
> addressee, you are hereby notified that reading, disseminating, distributing or
> copying this message is strictly prohibited. If you have received this message
> by mistake, please immediately notify us by replying to the message and delete
> the original message immediately thereafter. Thank you.
> ****
>
**** This message may contain confidential information intended only for the use of the addressee(s) named above and may contain information that is legally privileged. If you are not the addressee, or the person responsible for delivering it to the addressee, you are hereby notified that reading, disseminating, distributing or copying this message is strictly prohibited. If you have received this message by mistake, please immediately notify us by replying to the message and delete the original message immediately thereafter. Thank you. **** |
