Getting the file type from a placed file

Hi
I am trying to get the file type from items placed on a page. I know the types available has one of the three interfaces "IImageAttributes", "IEPSAttributes" or "IPDFAttributes", but how can i test whether the placed image is a TIF, JPG ... Of course i could test on the suffix or the file type (mac), but that isnt "secure" enough, since InDesign can place files with no filetype or extension, if they are in an importable format.
What I want in short, is to read the filetype shown in the Info palette, any one knows how to do this?
Jon

Thanks, I did take a look in these interfaces, but that didnt solve the problem for eps, pdf and other none raster types.
Instead I found the:
IDataLink->GetNameInfo()
Which gives me the string from the Info palette.

Similar Messages

  • How to get the Database type from weblogic Db connection

    I want to use database version control in my application . that means different database type use different Sql Statement. Such as in weblogic7.0 if I create SqlServer JDBC pool then I will use some special Sqlserver sql Statement . such as some join statement. If I create Oralce JDBC pool then I have to use different Sql statement . because these two database support different Sql statement.
    What my question is how to get the database type from the connection.

    For a normal jdbc driver you can use
    Connection.getMetaData()
    To get the meta data, in particular the getDatabase...() methods.
    That might or might not work.
    However, at the very least in the server you have access to the weblogic properties so you can parse the pool property to figure it out.

  • How to get the order type from notification number

    Hi,
    i have the notification number,
    fromthis number how can i get the Maintenance Order type.
    what is the table name to get the order type.
    Please tell me.

    Hi,
    First you read table QMEL with notification number and get AUFNR. Then go to AUFK and get AUART (order type).
    Some thing like,
    SELECT SINGLE aufnr INTO lv_aufnr FROM qmel WHERE qmnum EQ <your notification>.
    IF sy-subrc EQ 0 AND NOT lv_aufnr IS INITIAL.
      SELECT SINGLE auart INTO lv_auart FROM aufk WHERE aufnr EQ lv_aufnr.
    ENDIF.
    Hope this helps..
    Sri

  • How to get the field type from the database dictionary in screen painter

    hi,
    I wanted to create a new input field that input field should have the data element from the structure that i have created. How to get the data field type from the database dictionary in the screen painter

    hi
    good
    there is two kinds of evernt
    PROCESS ON HELP-REQUEST
    PROCESS ON VALUE-REQUEST.
    which ll help you to give two types of help one is f1 help and another one is f4 help
    go through this link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/47/e07f622b9911d2954f0000e8353423/content.htm
    thanks
    mrutyun

  • How to read the field type from field id of DynamicFldTbl

    Hi,
    In my application, i am using DynamicFldTbl, whch parses FML32 field table definition file. My field table definition file contains information about field names and its types.
    I checked the API of DynamicFldTbl and didn't find any API to get the field type from field it.
    Any way to read the field type from field id?
    Thanks in advance
    Raguraman

    Hi Raguraman,
    Once you have the field table, you can then create an FML32 buffer (TypedFML32) using the constructor that takes a field table, and then use the Fldtype() method on the specific field ID you wish to get the type of. I know this is sort of tedious and we should provide Fldtype() and some others on the field table class directly.
    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect

  • How is it posible to get the File name, size and type from a File out the H

    How is it posible to get the File name, size and type from a File out the HttpServletRequest. I want to upload a File from a client and save it on a server with the client name. I want to conrole before saving the name, type and size of the file.How is it posible to get the File name, size and type from a File out the HttpServletRequest.
    form JSP
    <form name="form" method="post" action="procesuploading.jsp" ENCTYPE="multipart/form-data">
    File: <input type="file" name="filename"/
    Path: <input type="text" readonly="" name="path" value="c:"/
    Saveas: <input type="text" name="saveas"/>
    <input name="submit" type="submit" value="Upload" />
    </form>
    proces JSP
    <%@ page language="java" %>
    <%@ page import="java.util.*" %>
    <%@ page import="FileUploadBean" %>
    <jsp:useBean id="TheBean" scope="page" class="FileUploadBean" />
    <%
    TheBean.doUpload(request);
    %>
    BEAN
    import java.io.*;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletInputStream;
    public class FileUploadBean {
    public void doUpload(HttpServletRequest request) throws IOException
              String melding = "";
              String filename = request.getParameter("saveas");
              String path = request.getParameter("path");
              PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("test.java")));
              ServletInputStream in = request.getInputStream();
              int i = in.read();
              System.out.println("filename:"+filename);
              System.out.println("path:"+path);
              while (i != -1)
                   pw.print((char) i);
                   i = in.read();
              pw.close();
    }

    Thanks it works great.
    Here an excample from my code
    import org.apache.commons.fileupload.*;
    public class FileUploadBean extends Object implements java.io.Serializable{
    String foutmelding = "geen";
    String path;
    String filename;
    public boolean doUpload(HttpServletRequest request) throws IOException
         try
         // Create a new file upload handler
         FileUpload upload = new FileUpload();
         // Set upload parameters
         upload.setSizeMax(100000);
         upload.setSizeThreshold(100000000);
         upload.setRepositoryPath("/");
         // Parse the request
         List items = upload.parseRequest(request);
         // Process the uploaded fields
         Iterator iter = items.iterator();
         while (iter.hasNext())
         FileItem item = (FileItem) iter.next();
              if (item.isFormField())
                   String stringitem = item.getString();
         else
              String filename = "";
                   int temp = item.getName().lastIndexOf("\\");
                   filename = item.getName().substring(temp,item.getName().length());
                   File bestand = new File(path+filename);
                   if(item.getSize() > SizeMax && SizeMax != -1){foutmelding = "bestand is te groot.";return false;}
                   if(bestand.exists()){foutmelding ="bestand bestaat al";return false;}
                   FileOutputStream fOut = new FileOutputStream(bestand);     
                   BufferedOutputStream bOut = new BufferedOutputStream(fOut);
                   int bytesRead =0;
                   byte[] data = item.get();
                   bOut.write(data, 0 , data.length);     
                   bOut.close();
         catch(Exception e)
              System.out.println("er is een foutontstaan bij het opslaan de een bestand "+e);
              foutmelding = "Bestand opsturen is fout gegaan";
         return true;
         }

  • Problem with getting the file name and type from OAMessageFileUploadBean

    Hi Tapash,
    I am trying the code below to get the file name and mime type from OAMessageFileUploadBean,
    DataObject fileUploadData = (DataObject)pageContext.getNamedDataObject("Documents");
    String uFileName = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_NAME");
    String contentType = fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE");
    But this piece of code gives errors saying that selectValue selectValue(null, java.lang.String) not found in class oracle.svc.DataObject
    Any ideas? why this code is giving error?
    Can i handle the event of browse button for OAMessageFileUploadBean?
    Regards,
    Nagesh Manda.

    Try using class oracle.cabo.ui.data.DataObject
    --Shiv                                                                                                                                                                                                       

  • Functional module to get the File from a given Directory

    Hi all,
    I am using a FM name 'subst_get_file_list' to get the file from a given directory but it is accepting only 40 Character length file only my requirement is to accept file name other than 40 char,
    give me good sugestion
    regards
    paul

    Hi Paul,
    Check the Function Module Gayathri has given. ie. 'SO_SPLIT_FILE_AND_PATH'.
    In the exporting parameter FULL_NAME , give the path name and in the importing parameter stripped_name , you will get the filename.
    Check this code.
    REPORT ZSHAIL_SPLITFILE.
    data: it_tab type filetable with header line,
          gd_subrc type i.
    tables: rlgrap.
    data: path type string,
          file_name type string.
    parameters file_nam type rlgrap-filename .
    data: user_act type i.
    at selection-screen on value-request for file_nam.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
      EXPORTING
        WINDOW_TITLE            = 'select a file'
       DEFAULT_EXTENSION       = '*.txt
        DEFAULT_FILENAME        = ''
        FILE_FILTER             = '*.txt'
        INITIAL_DIRECTORY       = ''
        MULTISELECTION          = abap_false
       WITH_ENCODING           =
      CHANGING
        file_table              = it_tab[]
        rc                      = gd_subrc
        USER_ACTION             = user_act
       FILE_ENCODING           =
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_GUI            = 3
        NOT_SUPPORTED_BY_GUI    = 4
        others                  = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    if user_act = '0'.
    loop at it_tab.
    file_nam = it_tab-filename.
    endloop.
    endif.
    path = file_nam.
    CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'
      EXPORTING
        full_name           = path
    IMPORTING
       STRIPPED_NAME       = file_name
      FILE_PATH           =
    EXCEPTIONS
      X_ERROR             = 1
      OTHERS              = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    at selection-screen.
    message i001(zmess) with file_name.
    Regards,
    SP.

  • Get the File information(data) from Directory AL11.

    Hi Friends,
    I want to get the file data from the given particular directory(which maintained in AL11) in the selection screen.
    for listing the files from the directory, i used FM 'RZL_READ_DIR_LOCAL'. it displaying only files what ever in the given directory.
    But my requirement is to display the complete data in the file ( log file contents).
    please suggest me with relevant Function module or logic.
    Thank you.
    Regards
    Ramesh M

    HI,
    Try using function module:
    PARAMETERS:     p_fname    LIKE rlgrap-filename               .
    data l_path       TYPE dxlpath       .
    DATA: l_true       TYPE btch0000-char1.
    *-- F4 functionality for filename on Application Server
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
        EXPORTING
          directory        = '/usr/sap/input'
          filemask         = ''
        IMPORTING
          serverfile       = l_path
        EXCEPTIONS
          canceled_by_user = 1
          OTHERS           = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        p_fname = l_path.  ""Here p_fname is the parameter for the user to select the file from the application server
      ENDIF.
    PFL_CHECK_OS_FILE_EXISTENCE
      DATA: l_file       TYPE tpfht-pffile.
      CLEAR l_file.
      l_file = p_fname.    "Here p_fname is the parameter for the user to select the file from the application server
      CALL FUNCTION 'PFL_CHECK_OS_FILE_EXISTENCE'
        EXPORTING
          fully_qualified_filename = l_file
        IMPORTING
          file_exists              = l_true.
      IF l_true = space.
        MESSAGE e001(zmsg).
      ENDIF.
    Hope it helps
    Regards
    Mansi

  • Get the File Name received from FTP Adapter

    Hi,
    How to get the File name reived through the FTP Adpater. I have created a variable with the Message type from ftpAdapterinboundheader.wsdl. from there I mapped the filename attribute to a local string variable.
    But I did not receive the file name. The output in the Audit trail is as follows:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <Invoke_File_Process_FileProcess_InputVariable>
    - <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="InputParameters">
    - <InputParameters xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/PIERS/SP_FILE_PROCESS_UPDATE/">
    <AS_DIR xmlns="">I</AS_DIR>
    <AS_FILE_NAME xmlns="" />
    </InputParameters>
    </part>
    </Invoke_File_Process_FileProcess_InputVariable>
    Can any one let me know how to get the recevied file name from FTP adapter.
    Thanks

    you have to define variable of type InboundHeader_msg. Then in receive activity click on Adapter tab and for header variable chose your newly created variable (InboundHeader_msg). Once you receive message from FTP you should see in this variable fileName.

  • How can i get the all values from the Property file to Hashtable?

    how can i get the all values from the Property file to Hashtable?
    ok,consider my property file name is pro.PROPERTIES
    and it contain
    8326=sun developer
    4306=sun java developer
    3943=java developer
    how can i get the all keys & values from the pro.PROPERTIES to hashtable
    plz help guys..............

    The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
    InputStream is = new FileInputStream("tivoli.properties");
    props.load(is);

  • How can I get the context-parm from a web.xml file using struts?

    Hello:
    I need get the context-param from the web.xml file of my web project using struts. I want configurate the jdbc datasource connection pooling here. For example:
    <context-param>
    <param-name>datasource</param-name>
    <param-value>jdbc/formacion</param-value>
    <description>Jdbc datasource</description>
    </context-param>
    and then from any Action class get this parameter.
    Similar using a simple server can be:
    /** Initiates new XServlet */
    public void init(ServletConfig config) throws ServletException {
              for (Enumeration e = config.getInitParameterNames(); e.hasMoreElements();) {
                   System.out.println(e.nextElement());
              super.init(config);
              String str = config.getInitParameter("datasource");
              System.out.println(str);
         public void doPost(HttpServletRequest req, HttpServletResponse res)
              throws ServletException, IOException {
              // res.setContentType( );
              System.out.println("Got post request in XServlet");
              PrintWriter out = res.getWriter();
              out.println("nada");
              out.flush();
              out.close();
    but only this works for init-params, if I use
    <servlet>
         <servlet-name>MyServlet</servlet-name>
         <display-name>MyServlet</display-name>
         <servlet-class>myExamples.servlet.MyServlet</servlet-class>
         <init-param>
         <param-name>datasource</param-name>
         <param-value>jdbc/formacion</param-value>
    </init-param>
    </servlet>
    inside my web.xml. I need something similar, but using struts inside the action class for that I can get the context-params and call my database.
    Thank you

    To get context parameters from your web.xml file you can simply get the ActionServlet object from an implementing action object class. In the perform (or execute) method make the following call.
    ServletContext context = getServlet().getServletContext();
    String tempContextVar =
    context.getInitParameter("<your context param >");

  • How can I get the example fonts from the font file Programmatically?

    Hi Friends,
             I am doing one mac application for the fonts management. Now I would like to Preview the Font in the NSTextView.  This is my coding for the textView.
        NSTextView *text3=[[NSTextView alloc]initWithFrame:NSMakeRect(250,500,450,30)];
        [text3 setString:@"ABCDEFGHIJKLMNOPQRSTUVWXYZ"];
        [text3 setFont:[NSFont fontWithName:@"GangofThree" size:40]];
        [[[self window] contentView] addSubview:text3];
    Because I have set the string in English for the NSTextView I can't able to view the other languages characters.I got the character set of the font file by using this code.
       NSCharacterSet *characterset = (NSCharacterSet *) CTFontCopyCharacterSet (fontRef);
    This Font is greek font.Now My question is how can I able to get the greek characters from this characterset.

    Your text string would certainly have to be in Greek itself, not Latin.  No normal font just translates Latin letters to Greek, they use other codepoints reserved for Greek letters.

  • File Adapter - how to get the file count from a folder

    Hi All,
    I have a requirement that have to poll a directory when the file count is reached to number N (ex:number of files avilable in folder is 5) otherwise it should wait and not pick any of the files. Is it possible to get the file count from a folder using file adapter ?? otherwise please suggest me an approach to achieve this requirement.
    Thanks,
    JJ

    Hi Sarath,
    Thank you for your reply.
    Go with the list files operation of file adapter it will gives you the number of files in the specified folder as you given. . - this step is already done.
    When the number of files reaches your count startup your webservice that which can polls the files. . . - how can i acheive this?? Have to poll the directory and process the number files - please let me know, what could be added to the webservice which is being invoked after cheking file count from parent process.
    The reason for the above question is - we cannot use ReadFile operation in second webservice because it will be automatically triggered when the file is avilable. Also SyncRead operation supports reading one file in b/w bpel process. Kindly explain me the implementation steps.
    Thanks,
    JJ

  • FM to get the file from application server to presenatation server automati

    Hi!
    In my upload program I am egtting the error log file onmy application server directly. Is there a function module or a way that in my abap code I can mention to bring the file or transfer the file to the presentation server . As my program is been run in the back ground so I cannot directly get the file on the presenattion server, so I need to bring it back on teh presentation server back to see teh eror log.
    I would like my program to do the transfer in background itself so that I can see the error log on a daily basis from my local file .
    Thanks
    when 'X'.                      "X is application server
    *         TRANSLATE p_err USING '\/'." correct slash for unix
          open dataset p_err2 for output in text mode encoding default.
          if sy-subrc = 0.
            loop at t_err into s_nts.
              transfer s_nts to p_err2.
              if sy-subrc ne 0.
                message i010(ad) with p_err2 'Download Failed'.
              endif.
            endloop.
            close dataset p_err2.
          else.
                message i010(ad) with p_err 'dataset could not be found'.
            sy-subrc = -1.             "Maintain error condition
          endif.
    *        endif.
          when ' '.                      "Blank is presenation server
            translate p_err using '/\'."correct slash Dos file
            call function 'DOWNLOAD'
              EXPORTING
                filename = p_err
                filetype = 'ASC'   "FTYPE set to DAT in DATA seg
              TABLES
                data_tab = t_err.
            if sy-subrc ne 0.
              message i010(ad) with 'File ' p_err 'cannot be located.'.
              sy-subrc = -1.             "Maintain error condition
              exit.
            endif.
        endcase.
      ENDIF.
    Thanks

    SO , after reading all , I assume that there is no way in which when I run the background job and get a errro file on application server can be retrievd on my presenattion serevr during the background job run. I was thinking that theer might be a functionn module which will convert the application server file into presenttion server file during the program run in background and store it in the location provided.
    I was trying to use FM  CALL FUNCTION 'C13Z_APPL_TO_FRONT_END' and  CALL FUNCTION 'ARCHIVFILE_SERVER_TO_SERVER' but using teh first one asks for source file and destination file name during teh program run and as it runs in background it cannot be provided again and again and teh second one dosent seem to work.
    Thanks

Maybe you are looking for