How to determine mime-type of a file using OSB

I was working on a requirement where in it requires to use FILE/ FTP adapters using OSB or BPEL as solution. The idea is to pick up files from one location to another location for certain legacy platforms. The real issue is, someone can put a JPEG file in the upload/download location(s), merely by changing the extensions. When this happens the systems will not process since the mime-type is incorrect.
I know of an open-source API (Apache-Tikka) to determine the mime-types, but then if we use open-source why would customer buy from us.
The intention is to pick-up the file and simply pass-it (and not parse) on to next system using File or FTP adapter, but in the process, cross check the MIME-TYPE before doing so.
Any solution using Oracle Service Bus or BPEL would help

HI Birender,
Kindly go through the metalink doc for processsing jpeg/xml/pdf etc any atachement using bpel :Understanding XPATH functions for processing MIME attachments with BPEL PM in SOA Suite 11gR1 [ID 1272093.1]
Regrds,
olety

Similar Messages

  • How to set Mime Type for Static Files

    Hi All,
    I am working on Apex 3.2.1.00.10.
    When I am trying to upload (create) a ".js" file into Static Files under Shared Components of an application; it is saving as "*text/plain*" for Mime Type. But I need Mime type to be set as "*application/x-javascript*".
    Please help me to change the Mime type of .js file.
    Or is there any way to upload the file directly as "*application/x-javascript*" as its Mime Type.
    Thanks in advance.
    Umesh

    In IIS v4 which comes with the Windows NT4 option pack, you right click the web page you are working with, select properties, then go to the HTTP Headers tab. At the bottom there's a button labelled File Types in the MIME Map section.
    After you've clicked that, you can add the two mime types you need;
    Associated Extension MIME Type
    .jar application/x-java-jar-file
    .jnlp application/x-java-jnlp-file
    I'm assuming that it is the same in W2k/IIS5.

  • How to determine mime type of multi-part message uploaded to rest api?

    I have a rest api that is used to upload data from different types of clients and serves as a proxy to write data to Azure blob storage. For testing, I'm using Fiddler on a PC.
    The code in my rest api that writes to blob storage looks like this:
    try
    await blockBlob.UploadFromStreamAsync(requestMessage.Content.ReadAsStreamAsync().Result);
    catch (Exception ex)
    HttpResponseMessage _hrm = new HttpResponseMessage(HttpStatusCode.InternalServerError);
    _hrm.ReasonPhrase = ex.Message;
    throw new HttpResponseException(_hrm);
    1 - How can I access the form-data that is included in the POST that has the original file name and the content-tyipe?
    2 - How can this info be passed to the blob when I write it out?  Currently, it is written out as a type of application/octet-stream instead of video/mp4.

    I think I found a solution using some other threads.  I'm not sure if it's the most performant or best but I'm able to get to the content-disposition and the content-type of the stream to get the details:
    Dictionary<string, string> lstLines = new Dictionary<string, string>();
    string[] _tmp;
    TextReader textReader = new StreamReader(requestMessage.Content.ReadAsStreamAsync().Result);
    string sLine = textReader.ReadLine();
    Regex regex = new Regex("(^content-type)|(^content-disposition)", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Singleline);
    while (sLine != ""
    && sLine != null)
    if (regex.Match(sLine).Success)
    _tmp = sLine.Split(':');
    lstLines.Add(_tmp[0], _tmp[1]);
    sLine = textReader.ReadLine();

  • How to Determine Color types in a file?

    How can we tell if a document has any CMYK, RGB or Pantone colors within any object (curves, text, etc.)?  The requires are just to report that the document has any CMYK and/or RGB and/or Pantone colors.  We already can get the color for a bitmap image on the document, it's the other objects on the document.
    Thanks...

    What I do to make a quick check of a Document is open the Document Info panel. If you want to see what is an object, select only that object, if you want to see what is in all objects select all. In the Document Info panel fly out menu (upper right corner of the panel) select Object to see information on number of objects and what colors are used. If you want to see what Spot Colors are used select the Spot Color Objects from this same fly out menu. Hope this helps but it sounds like you may need more robust preflight tools.

  • How to determine the MIME types of the files?

    I'm making an application, in which I've to upload the files to the database. Now I want to insert into the database the MIME type of the files. Now how can I know that which type of the file is having which MIME type?
    where can I get the list of all supported MIME types?
    Even if I get the list, then every time I update the file in the database, so every time I have to check the file extension and then insert the MIME type...
    this seems to be a tedioius job..
    Is there any simple way to do this?

    I could ask "supported by what?" but I assume you will
    be the one supporting them. Here's a link to the
    latest list of registered MIME types.HERE's the link...
    ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media-types

  • How To Get FileType and MIME Type from a File

    Hi,
    I am using following ways to get FileType and MIME Type.
    I am able to get file type, but I am getting MIME Type as */*
    Can any one please let me know how to get MIME Type, but it should not be time consuming process.
    For File Type I am using following Code:
    private String getFileData(InputStream inStream) {
    fileName = C:\temp\temp.tiff
    String filePath = Util.createTempFile(fileName);
    RandomAccessFile raf = new RandomAccessFile(filePath, "rw");
    while (inStream.available() > 0) {
         byte[] buf = new byte[inStream.available()];
         inStream.read(buf);
         raf.write(buf);
    inStream.close();
    raf.close();
    File file = new File(filePath);
    JFileChooser chooser = new JFileChooser();
    String fileType = chooser.getTypeDescription(file);
    file.delete();
    //MIME Type I am getting from
    DataHandler data = new DataHandler(new DocumentSource(inStream));
    data.getContentType();
    data.getContentType() is not working well in all cases.
    Can any one help me on this.
    Thanks in advance,
    Ram.
    Edited by: javausers07 on Apr 15, 2009 4:25 PM

    javausers07 wrote:
    Hi,
    I am using following ways to get FileType and MIME Type.
    I am able to get file type, but I am getting MIME Type as */*
    Can any one please let me know how to get MIME Type, but it should not be time consuming process.
    For File Type I am using following Code:
    private String getFileData(InputStream inStream) {
    fileName = C:\temp\temp.tiff
    String filePath = Util.createTempFile(fileName);
    RandomAccessFile raf = new RandomAccessFile(filePath, "rw");
    while (inStream.available() > 0) {
         byte[] buf = new byte[inStream.available()];
         inStream.read(buf);
         raf.write(buf);
    inStream.close();
    raf.close();
    File file = new File(filePath);Why do you do all above?
    JFileChooser chooser = new JFileChooser();
    String fileType = chooser.getTypeDescription(file);
    file.delete();
    //MIME Type I am getting from
    DataHandler data = new DataHandler(new DocumentSource(inStream));
    data.getContentType();
    data.getContentType() is not working well in all cases.That's because there's no way to get MIME type of all files on all filesystems.
    Kaj

  • How to determine IE type(32 bit or 64 bit) in a task sequence while updating Java

    How to determine IE type(32 bit or 64 bit) in a task sequence
    Hi,
    Currently i have to update new version of Java after removing all the previous existing version of Java by using TS in SCCM 2007.
    we have both 32 bit and 64 bit browser in the environment. I am stucked in determining whether the browser is of 32 bit or 64 bit.
    How to determine IE type(32 bit or 64 bit) in a task sequence so that respective java can be installed for that IE browser.
    will highly appreciate quick response.
    Thanks in advance.
    Daya

    But you also need to install JRE x86 on x64 systems, since most people actually use the 32bit browsers on x64 systems.
    The detection logic is actually pretty simple -- just check the right registry hive to find the installation location of the BIN\JAVA.DLL. Both pathnames are stored in HKLM\Software\JavaSoft\Java Runtime Environment\1.7 in the registry value "JavaHome",
    but the x86 path is stored in the 32-bit hive and the x64 path is stored in the 64-bit hive.
    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

  • (261705413) Q RPCC-21 Missing text/xml MIME-type for WSDL files?

    Q<RPCC-21> Would it mess up the SOAP operations that clients do when using the
    WSDL in a dynamic client to put a text/xml mime type in the WSDL-providing jsp?
    A<RPCC-21>: It is a known issue that the MIME-type for WSDL files is not appropriately
    transmitted so some web browsers will not identify an appropriate helper application
    when they are viewed (for Netscape just press Ctrl-U to view the source). This,
    however, does not affect the dynamic client as evidenced by the example code seen
    in the code demonstration.
    Adam

    SR,
    You probably already have the answer by now, but I just came across the same problem and found the answer elsewhere.
    The trick is to have the JavaMail jar in your classpath BEFORE the JAF jar. Given the habit of my development environment to sort jars alphabetifally it had me stumped for a bit.
    Good luck
    Marc

  • The type of Raw File used in my Canon 7D MKll is not supported in Bridge, Camera Raw or Photoshop 5S. How can I fix this?

    The type of Raw File used in my Canon 7D MKll is not supported in Camera Raw, Adobe Bridge or Photoshop 5S. How do I fix this?

    I gather you are using Photoshop CS5? The most recent Camera Raw version that CS5 will accept is ACR 6.7. Support for the Canon 7D Mark II was added in ACR 8.7.1. You will have to use the DNG converter to covert your CR2 files to the universal DNG raw format. Here are the links for the DNG converter:
    Adobe - Adobe Camera Raw and DNG Converter : For Windows : Adobe DNG Converter 8.7.1
    Adobe - Adobe Camera Raw and DNG Converter : For Macintosh : Adobe DNG Converter 8.7.1
    Benjamin

  • Standard mime type for .acsm file

    What is the standard mime type that should be used for an .acsm file?
    Is it this? - application/vnd.adobe.adept+xml
    I can see few eBook sellers sharing this mime type: application/vnd.adobe.adept (without the +xml).  I can see in such cases few of the free reader apps availbale in android / iOS are not recognizing the file.
    Pl advice.
    Thanks, Sundar

    I believe from looking around on the web, just the following is used:
    application/xml
    Take care, Mike
    Message was edited by: MikeWenzloff

  • How to get Header in Downloaded .xls file using  GUI_Download function

    How to get Header in Downloaded .xls file using  GUI_Download function ???
    How to use the the Header parameter available in GUI_Download function .

    HI,
    see this sample code..
    data : Begin of t_header occurs 0,
           name(30) type c,
           end of t_header.
    data : Begin of itab occurs 0,
           fld1 type char10,
           fld2 type char10,
           fld3 type char10,
           end   of itab.
    DATA: v_pass_path TYPE string.
    append itab.
    itab-fld1 = 'Hi'.
    itab-fld2 = 'hello'.
    itab-fld3 = 'welcome'.
    append itab.
    append itab.
    append itab.
    append itab.
    append itab.
    t_header-name = 'Field1'.
    append t_header.
    t_header-name = 'Field2'.
    append t_header.
    t_header-name = 'Field3'.
    append t_header.
      CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
        EXPORTING
          default_extension     = 'XLS'
        IMPORTING
          fullpath              = v_pass_path.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                        = v_pass_path
          filetype                        = 'DBF'
        TABLES
          data_tab                        = itab
          FIELDNAMES                      = t_header
    Cheers,
    jose.

  • How to get field separator in flat file using GUI_DOWNLOAD function

    hi,
    how to get field separator in flat file using GUI_DOWNLOAD function.
                                    thanking you.

    Hi,
      Use WRITE_FIELD_SEPARATOR = 'X'.
      Check this sample code
    REPORT  z_file_download.
    DATA: w_name(90) TYPE c.
    DATA:
      BEGIN OF fs_flight,
        carrid   LIKE sflight-carrid,
        connid   LIKE sflight-connid,
        fldate   LIKE sflight-fldate,
        price    LIKE sflight-price,
        currency LIKE sflight-currency,
      END OF fs_flight.
    DATA:
      BEGIN OF fs_head,
        carrid(10) TYPE c,
        connid(10) TYPE c,
        fldate(10) TYPE c,
        price(10) TYPE c,
        curr(10) TYPE c,
      END OF fs_head.
    DATA:
      t_head LIKE
       TABLE OF
             fs_head.
    DATA:
      t_flight LIKE
         TABLE OF
               fs_flight.
    fs_head-carrid = 'CARRID'.
    fs_head-connid = 'CONNID'.
    fs_head-fldate = 'FLDATE'.
    fs_head-price  = 'PRICE'.
    fs_head-curr   = 'CURRENCY'.
    APPEND fs_head TO t_head.
    SELECT-OPTIONS:
      s_carrid FOR fs_flight-carrid.
    START-OF-SELECTION.
      SELECT carrid
             connid
             fldate
             price
             currency
        FROM sflight
        INTO TABLE t_flight
       WHERE carrid IN s_carrid.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
    *   BIN_FILESIZE                  =
        filename                      = 'D:\flight.xls'
       FILETYPE                      = 'ASC'
    *   APPEND                        = ' '
        WRITE_FIELD_SEPARATOR         = 'X'
    *   HEADER                        = '00'
    *   TRUNC_TRAILING_BLANKS         = ' '
    *   WRITE_LF                      = 'X'
    *   COL_SELECT                    = ' '
    *   COL_SELECT_MASK               = ' '
    *   DAT_MODE                      = ' '
    *   CONFIRM_OVERWRITE             = ' '
    *   NO_AUTH_CHECK                 = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   WRITE_BOM                     = ' '
    * IMPORTING
    *   FILELENGTH                    =
      tables
        data_tab                      = t_head
    EXCEPTIONS
       FILE_WRITE_ERROR              = 1
       NO_BATCH                      = 2
       GUI_REFUSE_FILETRANSFER       = 3
       INVALID_TYPE                  = 4
       NO_AUTHORITY                  = 5
       UNKNOWN_ERROR                 = 6
       HEADER_NOT_ALLOWED            = 7
       SEPARATOR_NOT_ALLOWED         = 8
       FILESIZE_NOT_ALLOWED          = 9
       HEADER_TOO_LONG               = 10
       DP_ERROR_CREATE               = 11
       DP_ERROR_SEND                 = 12
       DP_ERROR_WRITE                = 13
       UNKNOWN_DP_ERROR              = 14
       ACCESS_DENIED                 = 15
       DP_OUT_OF_MEMORY              = 16
       DISK_FULL                     = 17
       DP_TIMEOUT                    = 18
       FILE_NOT_FOUND                = 19
       DATAPROVIDER_EXCEPTION        = 20
       CONTROL_FLUSH_ERROR           = 21
       OTHERS                        = 22
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = 'D:\flight.xls'
          filetype                = 'ASC'
          append                  = 'X'
          write_field_separator   = 'X'
        TABLES
          data_tab                = t_flight
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          OTHERS                  = 22.
      IF sy-subrc EQ 0.
        MESSAGE 'Download successful' TYPE 'I'.
      ENDIF.
      IF sy-subrc <> 0.
    *  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

  • How can we get  tag of XML file using SAX

    Hi ,
    I'm parsing one SAX parser , I'have almost done this parsing. i have faced problem for one case, i'e how can we get tag from XML file using SAX parser?
    XML file is
    <DFProperties>
    <AccessType>
    <Get/>
    </AccessType> <Description>
    gdhhd
    </Description>
    <DFFormat>
    <chr/>
    </DFFormat>
    <Scope>
    <Permanent/>
    </Scope>
    <DFTitle>gsgd</DFTitle>
    <DFType>
    <MIME>text/plain</MIME>
    </DFType>
    </DFProperties>
    I want out like GET and Permanent... means this one tag which is present inside of another tag.
    Handler class like
    public void startElement(String namespaceURI, String localName,
                   String qName, Attributes atts) throws SAXException {
    if(_ACCESSTYPE.equals(localName)){
                   accessTypeElement=ACCESSTYPE;
    public void characters(char[] ch, int start, int length)
                   throws SAXException {
    if (_ACCESSTYPE.equals(_accessTypeElement)) {
                   String strValue = new String(ch, start, length);
                   System.out.println("Accestype-----------------------------> " + strValue);
                   //System.out.println(" " + strValue);
    public void endElement(String namespaceURI, String localName, String qName)
                   throws SAXException {
    if (_ACCESSTYPE.equals(localName)) {
                   _accessTypeElement = "";
    . please any body help me

    Hi ,
    I have one problem,Please help me.
    1. How can I'll identify where exactly my Node is ended,means how how can we find corresponding nodename? in partcular place
    <Node> .............starttag1
    <NodeName>Test</NodeName>
    <Node>................starttag2
    <nodeName>test1</NodeName>
    </Node>..................endtag2
    <Node>.....................starttag3
    <NodeName><NodeName>
    <Node> .........................starttag4
    <NodeName>test4</NodeName>
    </Node>.......enddtag4
    </Node>...........end tag3
    </Node>............endtag1
    my code is below
    private final String _NODENAME = "NodeName";
    private final String _NODE = "Node";
    private String _nodeElement = "";
         private String _NodeNameElement = "";
    public void startElement(String namespaceURI, String localName,
                   String qName, Attributes atts) throws SAXException {
    if (_NODENAME.equals(localName)) {
                   NodeNameElement = NODENAME;
    if(_NODE.equals(localName)){
         System.out.println("start");
         if (_NODENAME.equals(localName)) {
                   NodeNameElement = NODENAME;
    public void characters(char[] ch, int start, int length)
                   throws SAXException {
    if (_NODENAME.equals(_NodeNameElement)) {
                   String strValue = new String(ch, start, length);
                   String sttt=strValue;
                   System.out.println("NODENAME: ************* " + strValue);
    if(_NODE.equals(_nodeElement)){
                   if (_NODENAME.equals(_NodeNameElement)) {
                        String strValue = new String(ch, start, length);
                        String sttt=strValue;
                        System.out.println("nodevalue********** " + strValue);
    public void endElement(String namespaceURI, String localName, String qName)
                   throws SAXException {
    if (_NODENAME.equals(localName)) {
                   _NodeNameElement = "";
    if(_NODE.equals(localName)){
                   System.out.println("NODENAME: %%%%%%%%%");
    please help me. How can I figure node ending for particular nodename

  • How 2 get the path of a file Using jsp

    how 2 get the path of a file Using jsp
    i have tried getPath...but i'm geting the error
    The method getPath(String) is undefined for the type HttpServletRequest
    any idea how 2 get the path of a file

    You need ServletContext#getRealPath().
    API documentation: http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html#getRealPath(java.lang.String)

  • How can I create an csv/excel file using pl/sql and then sending that file

    How can I create an csv/excel file using pl/sql and then sending that file to a clients site using pl/sql?
    I know how to create the csv/excel file but I can't figure out how I would get it to the clients site.

    968776 wrote:
    How can I create an csv/excel file using pl/sql and then sending that file to a clients site using pl/sql?
    I know how to create the csv/excel file but I can't figure out how I would get it to the clients site.You are trying to do it at a wrong place..
    Whay do you want database (pl/sql) code to do these things?
    Anyhow, you may be interested in :
    {message:id=9360007}
    {message:id=9984244}

Maybe you are looking for

  • Photoshop CS5 and CS6 not opening after Windows 7 update

    Hi there! I have my Mac on repair so I have to use Photoshop on a very old Windows 7 laptop of mine (the first PS licence I bought was for PS CS4 Win then extended to CS5 during grace period) It always worked fine (slow but fine ) since today. I was

  • What is use of asteric sign in oracle

    Updat TableA Tout set col3,col4 = (select col3,col4 from TableA Tin where Tin.col1=Tout.col1 and Tin.col2=Tout.col2 and Tin.coln=*'B'* ) where coln=*'A'

  • An external source changing the page shown when a new tab is opened.

    I recently downloaded some freeware and, without permission, it installed some malware by the name of My Start by Incredibar that hijacked the home page, new tab page, default search engine, and other functions in Firefox. The removal of the program

  • Support "notifications"?

    I have been getting a surprisiing volume of junk emails that purport to be from some "support" service.  Some are labeled "Apple Support" , some seem to come from Facebook and some are labeled "Gmail support."  Thankfully they are diverted to my junk

  • Want to Create SliderView using JavaFX,like we desingHTML page using JQuery

    I want to create a slider view using javafx2.0.3, when we click on left button the images moves left and come from right side. Like we are creating using JQuery in HTML. from left to right. Anyone know, how it is possinle in Javafx 2.0, Please tell m