Problems getting just the file name using an upload component

Hi everyone, I'm using an upload component on my page and I need to get just the name of the image/file in order to store it in a database, I used the code of the tutorial and It works fine on mozilla but the problem comes when I use Internet Explorer because I get the whole path of the image/file and not just the name of it. I believe the browser is the cause of the problem, I already checked the http://jakarta.apache.org/commons/fileupload/, but I don't understand how to use anything, and not even the code of the tutorial works eventhough it is specified in comments:
// some browsers return complete path name, some don't
   // make sure we only have the file name
   String justFileName = uploadedFileName.substring
      ( uploadedFileName.lastIndexOf(File.separatorChar) + 1 );If anybody could helpme solve this problem I'd appreciate it so much
Regards
Yes
Message was edited by:
Yesenia

Let's walk through the code...
File.separatorChar is the system-dependent default hame-separator charac tor. This field is initialized to contain the first character of the system property file.separator. On UNIX systems, the value of this field is '/'; on Microsoft Windows systems it is '\\'.
String justFileName =
// get the substring of uploadedFileName
// that starts after the last separator (\ or /)
uploadedFileName.substring
uploadedFileName.lastIndexOf(File.separatorChar) + 1
You say that this statement is returning the complete path name, for example:
C:\Documents and Settings\All
Users\Documentos\Mis im��genes\Im��genes de
muestra\Puesta de sol.jpgSo, we can make an assumption that the File.separatorChar must not be \, or else the statement would return Puesta de sol.jpg.
We know that it works for you on Solaris/Mozilla.
We also know that Misha has tested the statement in IE and it works for him.
(And I know that this tutorial was tested by a software engineer and a quality engineer, and it worked for both of them, as well as the tutorial author and a peer).
So, what is different here??????
Can you print out File.separatorChar and see if it is '\\' (I think the first \ is an escape char, that is \\ (escape-escape) is the equivalent of \ (backslash)) or '\'?
When you run it on another machine, how are you deploying it on the other machine? Is it deployed to Solaris and running on Windows?
Have you tested to see if it works on a Windows machine using Mozilla?
Thanks in advance for any light you can shed on the problem.

Similar Messages

  • How to get the full path instead of just the file name, in �FileChooser� ?

    In the FileChooserDemo example :
    In the statement : log.append("Saving: " + file.getName() + "." + newline);
    �file.getName()� returns the �file name�.
    My question is : How to get the full path instead of just the file name,
    e.g. C:/xdirectory/ydirectory/abc.gif instead of just abc.gif
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.filechooser.*;
    public class FileChooserDemo extends JFrame {
    static private final String newline = "\n";
    public FileChooserDemo() {
    super("FileChooserDemo");
    //Create the log first, because the action listeners
    //need to refer to it.
    final JTextArea log = new JTextArea(5,20);
    log.setMargin(new Insets(5,5,5,5));
    log.setEditable(false);
    JScrollPane logScrollPane = new JScrollPane(log);
    //Create a file chooser
    final JFileChooser fc = new JFileChooser();
    //Create the open button
    ImageIcon openIcon = new ImageIcon("images/open.gif");
    JButton openButton = new JButton("Open a File...", openIcon);
    openButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    int returnVal = fc.showOpenDialog(FileChooserDemo.this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
    File file = fc.getSelectedFile();
    //this is where a real application would open the file.
    log.append("Opening: " + file.getName() + "." + newline);
    } else {
    log.append("Open command cancelled by user." + newline);
    //Create the save button
    ImageIcon saveIcon = new ImageIcon("images/save.gif");
    JButton saveButton = new JButton("Save a File...", saveIcon);
    saveButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    int returnVal = fc.showSaveDialog(FileChooserDemo.this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
    File file = fc.getSelectedFile();
    //this is where a real application would save the file.
    log.append("Saving: " + file.getName() + "." + newline);
    } else {
    log.append("Save command cancelled by user." + newline);
    //For layout purposes, put the buttons in a separate panel
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(openButton);
    buttonPanel.add(saveButton);
    //Explicitly set the focus sequence.
    openButton.setNextFocusableComponent(saveButton);
    saveButton.setNextFocusableComponent(openButton);
    //Add the buttons and the log to the frame
    Container contentPane = getContentPane();
    contentPane.add(buttonPanel, BorderLayout.NORTH);
    contentPane.add(logScrollPane, BorderLayout.CENTER);
    public static void main(String[] args) {
    JFrame frame = new FileChooserDemo();
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    frame.pack();
    frame.setVisible(true);

    simply use file.getPath()
    That should do it!Thank you !
    It takes care of the problem !!

  • How to find the File name using the FTP Adapter

    hi all,
    how to find the File name using the FTP Adapter with BPEL.
    Regards

    Found the solution for this.
    First In the mediator's routing rule use assign property $in.property.jca.file.FileName to $out.property.jca.file.FileName
    In the BPEL's receive activity go to the properties tab and get the property to a BPEL variable. That should do it.
    Thanks for the posts

  • Getting the file name using ehdr:getRequestHeader function in style sheet

    Hi, I am facing an issue while using ehdr:getRequestHeader function to get the name of the file, which was placed in FTPS server and read by FTP Adapter. In style sheet I am trying to get the file name as below.
    <xsl:variable name="fileName"
    select="ehdr:getRequestHeader('/fhdr:InboundFTPHeaderType/fhdr:fileName','fhdr=http://xmlns.oracle.com/pcbpel/adapter/ftp/;')"/>
    and based on the file name I am trying to fetch the values from Property file, map it to a schema and make a SOAP service call.
    When i use the above functionality in style sheet exception occurs and in ESB instance I am not able to view the exception.
    It is saying as 'Details of the message are not available, The message details would have been purged'. In logs it is showing the following error trace.
    <MSG_TEXT>Failed to process deferred message</MSG_TEXT>
    <SUPPL_DETAIL>oracle.tip.esb.server.common.exceptions.BusinessEventRejectionException: Error occured while handling monitor message dequeued from monitor topic. Message text is "&lt;activityMessages>&lt;activityMessage order='10' type='6'>&lt;flowId>cRfy7g6a-8HDUKqyf4GsKw==&lt;/flowId>&lt;subFlowId>1245307693657&lt;/subFlowId>&lt;timestamp>1245307703862&lt;/timestamp>&lt;operationGUID>2F1C13905B3F11DE8F0BD923A1148BB1&lt;/operationGUID>&lt;operationQName>ESBTest.InvokeESB&lt;/operationQName>&lt;errorMessage>&lt;![CDATA[An unhandled exception has been thrown in the ESB system. The exception reported is: "org.collaxa.thirdparty.apache.wsif.WSIFException: exception on JaxRpc invoke: serialization error: java.lang.IllegalArgumentException: getSerializer requires a Java type and/or an XML type
            at com.collaxa.cube.ws.wsif.providers.oc4j.jaxrpc.WSIFOperation_JaxRpc.invokeOperation(WSIFOperation_JaxRpc.java:1714)
            at com.collaxa.cube.ws.wsif.providers.oc4j.jaxrpc.WSIFOperation_JaxRpc.invokeRequestResponseOperation(WSIFOperation_JaxRpc.java:1460)
            at com.collaxa.cube.ws.wsif.providers.oc4j.jaxrpc.WSIFOperation_JaxRpc.executeInputOnlyOperation(WSIFOperation_JaxRpc.java:1141)
            at oracle.tip.esb.server.common.wsif.WSIFInvoker.executeOperation(WSIFInvoker.java:894)
            at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(WSIFInvoker.java:810)
            at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(WSIFInvoker.java:832)
            at oracle.tip.esb.server.service.impl.outadapter.OutboundAdapterService.nextService(OutboundAdapterService.java:227)
            at oracle.tip.esb.server.service.impl.outadapter.OutboundAdapterService.processBusinessEvent(OutboundAdapterService.java:136)
            at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatchNonRoutingService(InitialEventDispatcher.java:407)
            at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatch(InitialEventDispatcher.java:165)
            at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1988)
            at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1467)
            at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:205)
            at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:136)
            at oracle.tip.esb.server.service.EsbRouterSubscription.onBusinessEvent(EsbRouterSubscription.java:310)
            at oracle.tip.esb.server.dispatch.EventDispatcher.executeSubscription(EventDispatcher.java:138)
            at oracle.tip.esb.server.dispatch.InitialEventDispatcher.processSubscription(InitialEventDispatcher.java:547)
            at oracle.tip.esb.server.dispatch.InitialEventDispatcher.processSubscriptions(InitialEventDispatcher.java:529)
            at oracle.tip.esb.server.dispatch.EventDispatcher.dispatchRoutingService(EventDispatcher.java:94)
            at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatch(InitialEventDispatcher.java:161)
            at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1988)
            at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1467)
            at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:119)
            at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:65)
            at oracle.tip.esb.server.service.impl.inadapter.ESBListenerImpl.processMessage(ESBListenerImpl.java:722)
            at oracle.tip.esb.server.service.impl.inadapter.ESBListenerImpl.onMessage(ESBListenerImpl.java:407)
            at oracle.tip.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage(MessageEndpointImpl.java:281)
            at oracle.tip.adapter.file.inbound.ProcessWork.publishMessage(ProcessWork.java:1173)
            at oracle.tip.adapter.file.inbound.ProcessWork.doTranslation(ProcessWork.java:882)
            at oracle.tip.adapter.file.inbound.ProcessWork.processMessages(ProcessWork.java:342)
            at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:224)
            at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
            at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
            at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:825)
            at java.lang.Thread.run(Thread.java:595)
    ]]&gt;&lt;/errorMessage>&lt;exception>&lt;![CDATA[oracle.tip.esb.server.common.exceptions.BusinessEventRetriableException: An unhandled exception has been thrown in the ESB system. The exception reported is: "org.collaxa.thirdparty.apache.wsif.WSIFException: exception on JaxRpc invoke: serialization error: java.lang.IllegalArgumentException: getSerializer requires a Java type and/or an XML type
            at com.collaxa.cube.ws.wsif.providers.oc4j.jaxrpc.WSIFOperation_JaxRpc.invokeOperation(WSIFOperation_JaxRpc.java:1714)
            at com.collaxa.cube.ws.wsif.providers.oc4j.jaxrpc.WSIFOperation_JaxRpc.invokeRequestResponseOperation(WSIFOperation_JaxRpc.java:1460)
            at com.collaxa.cube.ws.wsif.providers.oc4j.jaxrpc.WSIFOperation_JaxRpc.executeInputOnlyOperation(WSIFOperation_JaxRpc.java:1141)
            at oracle.tip.esb.server.common.wsif.WSIFInvoker.executeOperation(WSIFInvoker.java:894)
            at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(WSIFInvoker.java:810)
            at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(WSIFInvoker.java:832)
            at oracle.tip.esb.server.service.impl.outadapter.OutboundAdapterService.nextService(OutboundAdapterService.java:227)
            at oracle.tip.esb.server.service.impl.outadapter.OutboundAdapterService.processBusinessEvent(OutboundAdapterService.java:136)
            at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatchNonRoutingService(InitialEventDispatcher.java:407)
            at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatch(InitialEventDispatcher.java:165)
            at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1988)
            at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1467)
            at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:205)
            at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:136)
            at oracle.tip.esb.server.service.EsbRouterSubscription.onBusinessEvent(EsbRouterSubscription.java:310)
            at oracle.tip.esb.server.dispatch.EventDispatcher.executeSubscription(EventDispatcher.java:138)
            at oracle.tip.esb.server.dispatch.InitialEventDispatcher.processSubscription(InitialEventDispatcher.java:547)
            at oracle.tip.esb.server.dispatch.InitialEventDispatcher.processSubscriptions(InitialEventDispatcher.java:529)
            at oracle.tip.esb.server.dispatch.EventDispatcher.dispatchRoutingService(EventDispatcher.java:94)
            at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatch(InitialEventDispatcher.java:161)
            at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1988)
            at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1467)
            at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:119)
            at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:65)
            at oracle.tip.esb.server.service.impl.inadapter.ESBListenerImpl.processMessage(ESBListenerImpl.java:722)
            at oracle.tip.esb.server.service.impl.inadapter.ESBListenerImpl.onMessage(ESBListenerImpl.java:407)
            at oracle.tip.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage(MessageEndpointImpl.java:281)
            at oracle.tip.adapter.file.inbound.ProcessWork.publishMessage(ProcessWork.java:1173)
            at oracle.tip.adapter.file.inbound.ProcessWork.doTranslation(ProcessWork.java:882)
            at oracle.tip.adapter.file.inbound.ProcessWork.processMessages(ProcessWork.java:342)
            at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:224)
            at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
            at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
            at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:825)
            at java.lang.Thread.run(Thread.java:595)
            at oracle.tip.esb.server.common.wsif.WSIFInvoker.executeOperation(WSIFInvoker.java:1020)
            at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(WSIFInvoker.java:810)
            at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(WSIFInvoker.java:832)
            at oracle.tip.esb.server.service.impl.outadapte]]&gt;&lt;/exception>&lt;retryable>false&lt;/retryable>&lt;/activityMessage>&lt;/activityMessages>"
    at oracle.tip.esb.monitor.manager.ActivityMessageReceiver.handleMessage(ActivityMessageReceiver.java:96)
    at oracle.tip.esb.server.dispatch.agent.ESBWork.process(ESBWork.java:178)
    at oracle.tip.esb.server.dispatch.agent.ESBWork.run(ESBWork.java:132)
    at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
    at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
    at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:825)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: oracle.tip.esb.monitor.MonitorException: Due to the error "", the activity message could not be stored.
    at oracle.tip.esb.monitor.manager.database.AbstractFaultPersister.persist(AbstractFaultPersister.java:107)
    at oracle.tip.esb.monitor.manager.database.DBActivityMessageStore.persistMessage(DBActivityMessageStore.java:340)
    at oracle.tip.esb.monitor.manager.database.DBActivityMessageStore.store(DBActivityMessageStore.java:131)
    at oracle.tip.esb.monitor.manager.ActivityMessageReceiver.handleMessage(ActivityMessageReceiver.java:83)
    ... 7 more
    Caused by: java.lang.NullPointerException
    at oracle.tip.esb.monitor.manager.database.oracle.OracleFaultPersister.persist(OracleFaultPersister.java:102)
    at oracle.tip.esb.monitor.manager.database.AbstractFaultPersister.persist(AbstractFaultPersister.java:105)
    ... 10 more
    </SUPPL_DETAIL>
    When I use the same function getRequestHeader for FileAdapter, it is working fine. Do anyone know why this issue occurs? Is this an issue with environment?

    As far as I can see the problem is the invoke of the SOAP service. This could be because of an empty filename but maybe there are other issues. First, make sure that the filename is read correctly by looking it up in the BPEL runtime process. Maybe the content is different than you expected it so that the read action for the properties give wrong result. Are you sure that ehdr is the correct prefix for the ftpheader?

  • Get the file name using XSLT mapping

    Hi
    How to get the file Name at receiver side using XSLT mapping.
    Could any one please help me
    Regards
    sowmya

    Sowmya
    If you will use Grpahical Mesage Mapping then this can be achieved using Adapter-Specific Attribute u201CFileNameu201D
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
    Code Snippet -->
    DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(
    u201Chttp://sap.com/xi/XI/System/Fileu201D,
    u201CFileNameu201D);
    But in case you have to ONLY use XSLT mapping then I would suggest to use the same jave code & call it from your XSLT mapping. I never tried such thing you might use couple of jar files too.
    - lalit -

  • How to get DMS the file name

    Hi friends
    I need to retrive the file name of the  PDF created document , any one knows how to do it.
    I need also to move the file from the original the  folder to another  folder , is it possible to write an abap code to do that.
    Thanks

    Hi Experts,
    i try useing the DMS_KPRO_READ prog as you said above.
    The problem is that i need to retrieve list  (range) of documents and than save them.
    as it written now , i can do it just about one file.
    if u have any helpfull advice it will be real kindly.
    Thanks alot.
    Yuval.
    Edited by: student student on Nov 16, 2009 10:20 AM

  • Get/put dynamic file name using FTP

    Hi Friends,
      I am currently using FTP_Connect, FTP_command and FTP_disconnect to get/put a file from a remote server.
    But the file name was changed to add a date/time stamp.
    So the filename became dynamic (example from 'test.txt' to 'test_200512160800.txt').
    I tried using get test. but my FTP command failed. Do you know anyway of doing this?
    Thanks.

    Hi Lego,
    here's another sample for the fm:
    REPORT ztest_epsf.
    PARAMETERS: date LIKE sy-datum,
                dir  TYPE epsf-epsdirnam,
                pattern TYPE epsf-epsfilnam,
                zid   LIKE vers_dest-rfcdest.
    DATA dir_list LIKE epsfili OCCURS 0 WITH HEADER LINE.
    DATA cnt_file TYPE epsf-epsfilsiz.
    DATA err_file TYPE epsf-epsfilsiz.
    START-OF-SELECTION.
      IF date IS INITIAL.
        date = sy-datum.
      ENDIF.
    *build pattern with input-pattern and date
      CONCATENATE pattern date '*' INTO pattern.
    *search for files in foreign system
      CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
           DESTINATION                   zid
           EXPORTING
                dir_name               = dir
                file_mask              = pattern
           IMPORTING
                file_counter           = cnt_file
                error_counter          = err_file
           TABLES
                dir_list               = dir_list
           EXCEPTIONS
                invalid_eps_subdir     = 1
                sapgparam_failed       = 2
                build_directory_failed = 3
                no_authorization       = 4
                read_directory_failed  = 5
                too_many_read_errors   = 6
                empty_directory_list   = 7
                OTHERS                 = 8.
      WRITE: / pattern.
      ULINE.
      LOOP AT dir_list.
        WRITE: / dir_list-name.
      ENDLOOP.
      ULINE.
      WRITE: / cnt_file.
      WRITE: / err_file.
    pls reward points for useful hints.
    thanks and
    regards Andreas

  • A problem caused by the file name

    hi,i have a problem today,here is the source file:
    //saved as String.java
    class Strings{
    public static void main(String [] args){
    String x="java";
    System.out.println("x string ="+x);
    and when i try to compile it,the compiler complains as follows:
    javac String.java
    .\String.java:1: duplicate class: Strings
    class Strings{
    ^
    String.java:3: incompatible types
    found : java.lang.String
    required: String
    String x="java";
    ^
    String.java:4: operator + cannot be applied to java.lang.String,String
    System.out.println("x string ="+x);
    ^
    3 errors
    if the file was renamed(such as Strings.java) or add a line of package declearation,
    it would compile fine and run successfully...
    i wonder if it's because the String.class in the java.lang package was covered with
    something else? but i am not sure,please tell me the truth. Thanks!

    Two reasons:
    1. The file name must match the class name. Otherwise, the compiler and the JVM will not be able to locate your class.
    2. It's not a good idea to re-use the names from the core API. You can probably find a way round it, but String is such a commonly used class that it can only be confusing to use the same name.

  • Can I append date to the file name using Bursting

    Hi All,
    I know that we can append date to the file using %y, %m and %d for
    Email
    FTP
    WEBDAV
    But is there any way of appending the date to the file name if I am bursting my file to a shared location.
    I tried that %y, %m and %d but that doesn't work for bursting.
    Please reply
    Thanks,
    Ronny

    If this requirment is for EBS, please refer the following blog
    http://blogs.oracle.com/BIDeveloper/2010/08/xdoburstrpt_passing_parameters.html
    For standalone see the following delivery sql query as example.
    select
    d.department_name KEY,
    'Standard' TEMPLATE,
    'RTF' TEMPLATE_FORMAT,
    'en-US' LOCALE,
    'PDF' OUTPUT_FORMAT,
    'FILE' DEL_CHANNEL,
    'C:\Temp' PARAMETER1,
    d.department_name||'_'||to_char(sysdate,'mmddyyyy')|| '.pdf' PARAMETER2
    from
    departments d
    Thanks
    Ashish

  • Want To Capture The File name Using the SQL Loader

    Hi,
    I Am loading The Data To Staging Table Using The SQL*developer, The File That need to be Loaded Will be One Of The Input To the SQL*Loader Concurrent Program.
    In One Of The Column Of My staging Table I want To Put The File name.
    Can We do the Same.
    thanks,
    Ankit

    Not unless you generate the loader controlfile dynamically.. try this.. pass file name as $1 first parameter. Use the below example and modify as per your requirement
    1) create table with following table structure
    create table temp_table (x varchar2(20),file_name varchar2(30));
    2) create data file - test.dat (contains only values for x)
    abc
    def
    geh
    ggg
    fff
    3) create a host file host file - test.sh with following content:
    echo "load data
    infile $1
    append
    into table temp_table
    fields terminated by ','
    (x,
    file_name constant "$1")" > test.ctl
    sqlldr <usr>/<pwd>control=test.ctl
    4) run the host file from unix prompt with data file name as parameter (ensure test.sh has execute permissions)
    test.sh test.dat
    Hope this helps
    Regards,
    Bhadri

  • Where can I find the file name used by a External Table

    I need to run a SQL to retrive the file name that a External Table points to.

    take a look at dba_external_locations

  • When a group of files is selected, how can I copy just the file names?

    I used to be able to select a group of files in a finder window, copy, then paste the names in an email or document. It no longer allows this. Is there away around this other than copying each file name individually?

    I'm also at 10.5.4, just had forgotten to update my profile.
    One "gotcha" can be if the application, such as Mail, is actually able to DO something with the files. In the case of Mail, it can add the content of many sorts of files to the message, or add the files to a message as attachments. That's why the Clipboard will say the content is "text/items" since what will be pasted depends on the destination. This is relatively new in OS X--I remember being astonished when it first turned up.
    TextEdit, IF it is in Rich Text Format, can also handle a number of different sorts of files. If you want to use TextEdit as the "intermediate" destination to get a text list, be sure you go to the Format menu item, and select "Make Plain Text" before you paste. Actually, since I use TextEdit mainly for tasks, such as hand coding HTML, I have its default behavior to open all new windows in plain text, then if I actually want some formatting, I change it to Rich Text. In Rich Text it will accept pasting of all sorts of graphics files, so you see the jpeg, gif or png, you can even paste sound files in as actual sound files (and they'll play, too), plus the icons for folders and other files (such as PDFs).
    Francine
    Francine
    Schwieder

  • Add YYYYMMDD_xyz_ftp in front of the file name using PowerShell

    Hi All,
    I am working on a PowerShell script to generate a dat file. I need to change the format of this file as follows:
    Original File Name: eagle.dat
    Required File Name: YYYYMMDD_CA_eagle.dat
    I know that we can do this very easily from Windows Cmd like below. I have written this massive PowerShell script which I do not want to be wasted just because of this last step.
    rename eagle.dat %date:~-4,4%%date:~-10,2%%date:~-7,2%_CA_eagle.dat
    Thank you in advance for your reply.
    Ben

    Hi Ben,
    Give this a try:
    Rename-Item -Path .\eagle.dat -NewName ("{0:yyyMMdd}_CA_eagle.dat" -f (Get-Date))
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • Dynamically changing the file name using the submit button

    I am currently using a submit button to send information to myself from the user of the form. Is there any way to change the name of the file that is emailed as a .pdf file according to some type of parameter or data set that is collected in the form?

    Not programmatically. The attachment wil take the same name as the opened PDF. If you change the name of the PDF then it will change your form name as well. That cannot be done programmatically.

  • Home to get only the file name ?

    I m trying to get only the filnames without the path
    if( myDir.exists() && myDir.isDirectory()){
                  File[] files = myDir.listFiles();
                       for(int i=0; i < files.length; i++){
                            if (files.getName().indexOf(".xml") == -1)
                             continue;
                        System.out.println(files[i]);

    You answered your question
    files.getName().                                                                                                                                                                                                       

Maybe you are looking for