5 Replies Latest reply: Apr 25, 2014 7:53 PM by JJIN RSS

    Retrive full path shown in the file browse item

    JJIN

      Hi,

       

      I am using Apex 4.1. I am trying to retrieve the full path of a file upload item. This is for saving the full path as an entry in a text file. When clicking on a button i will get a popup to save the file. I am getting a number in the field of file path for example "1751925187429575/new test.txt". Is there any way i can get the complete path shown in the file browse item.(D:\new test.txt).

       

      Thanks,

      Jyo

        • 1. Re: Retrive full path shown in the file browse item
          jrimblas

          Sorry, this is not possible with the file browse item.  It's actually not an APEX restriction just the way file uploading works.

          The number you see is added so the file becomes unique and it's not mapped to the path.

           

          I have seen the behavior that sometimes the path comes along with the file, but that was more of a bug that could not be reliably be reproduced.

           

          It may be possible with some HTML5 and drag and drop to perhaps know that.  But I doubt this behavior will work correctly across all browsers.

           

          May I ask what is the requirement?  Why do you want to know the user's local machine path to the file?

           

          Thanks

          -Jorge

          • 2. Re: Retrive full path shown in the file browse item
            JJIN

            Hi Jorge,

             

            I have a file browse option to select a file name(it will open and can select a file name). There is a submit button in the page. When i click on the submit button a new popup screen will be created to save the configuration details from the page as a text file. This includes the local path of the file selected. The local path is required because this need to used by other tool to run a command.

             

            Thanks,

            ~Jyo

            • 3. Re: Retrive full path shown in the file browse item
              JJIN

              Any option where i can get a file browse kind of option where i can select the filename(path) will also be helpful. Any custom options to create this?

               


              • 4. Re: Retrive full path shown in the file browse item
                fac586

                719275 wrote:

                Please update your forum profile with a real handle instead of "719275".

                I am using Apex 4.1. I am trying to retrieve the full path of a file upload item. This is for saving the full path as an entry in a text file. When clicking on a button i will get a popup to save the file. I am getting a number in the field of file path for example "1751925187429575/new test.txt". Is there any way i can get the complete path shown in the file browse item.(D:\new test.txt).

                As has been noted in many previous threads on this topic: For security/privacy reasons recent current browsers by default do not send local file path information from File Browse items to the server, nor expose the file path in the control's JavaScript methods. Some legacy browsers (e.g. IE6 & IE7) will still yield the full path. Dismal legacy applications have forced IE8+ and other current browsers to adopt an utterly ridiculous approach of replacing the path with a wholly imaginary "C:\fakepath\"—and this has sadly had to be enshrined in the HTML5 spec...

                 

                On Internet Explorer, changing the security config setting "Include local directory path when uploading files" enables the path to be exposed, but unless you're working in an intranet environment where: IE is the only browser used; it's possible to make remote changes to this setting on every desktop; and this won't break/expose anything else, then trying to achieve this is pointless.


                For more information see:

                 

                 

                APEX handles this for you. "1751925187429575" is added to the NAME column to provide a unique file identifier in the APEX_APPLICATION_FILES view, and is the session state value of the file browse control that uploaded the file. The actual filename is available in the FILENAME column.

                I have a file browse option to select a file name(it will open and can select a file name). There is a submit button in the page. When i click on the submit button a new popup screen will be created to save the configuration details from the page as a text file. This includes the local path of the file selected. The local path is required because this need to used by other tool to run a command.

                Insufficient information. Browser(s)/version(s)? What configurations details? Save a text file where? What other tool? What command? Run it where?

                Any option where i can get a file browse kind of option where i can select the filename(path) will also be helpful. Any custom options to create this?

                This is taking on the appearance of an XY Problem. Please describe the requirements for this application in detail, not how you are currently trying to implement them.

                • 5. Re: Retrive full path shown in the file browse item
                  JJIN

                  Hi,

                   

                  I changed my handle name

                   

                  THe browser version will be IE,firefox or chrome.(will be latest version). I am actually doing a POC of the actual project. There are 5-6 page items in the page. One page item is a file browse option in which i can select a file. The other page items are text fields where i can enter details. Once i select the file and enter the details need to click a button. Then a text file download prompt will be shown. Here i can specify a path and save a text file(eg., import.txt)   in the local machine. The file need to contain the file name(with path),text field values in each line, like.

                   

                  D:/config_files/config_file1.config

                  tetx_field_value1

                  tetx_field_value2

                  ............

                  ..............

                   

                  The activities from Apex will ends here.

                   

                  The Other tool(I don't have much details about this tool) will take the file(import.txt)  from the local path  and process it( It will take the config file path from the text file and other details and execute a command, this is a manual activity. The user will periodically take the file(import.txt) and process it using commands specific to that tool)

                   

                  I don't have the details of the whole flow.(how the tool use this file).

                   

                  Sorry, i know this is a complex activity and don't have details about what the other tool will do with the details in the file.

                   

                  Thanks,

                  Jyo