8 Replies Latest reply: Jun 13, 2014 1:39 AM by fac586 RSS

    File browse item with out saving in Database

    JJIN

      Hi,

       

      I am looking for a file select/browse option where i can select the file from a folder and view the file path. But i don't need to save the file to either 'WWV_FILES' or BLOB column. Is there any way we can acheive this?. Baiscally i need to extract the filename from the path and use for other processing. I don't need the file to be saved in the database. Can we achieve this in Apex?

       

      I am using Apex 4.1.

       

      Thanks,

      Jyo

        • 1. Re: File browse item with out saving in Database
          Sunil Bhatia

          Hi Jyo,

           

          Your approach to it is incorrect.

           

          For security/privacy reasons recent versions of 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. Firefox, Safari and Chrome only provide the filename. IE6 & IE7 still yield the path in Windows format. IE8 and Opera have adopted an irritating approach of replacing the path with a wholly imaginary "C:\fakepath\".


           

          Changes to IE's security config can enable the path to be exposed in IE8, but I don't think it will be available via apex_application_files

           


          For more information see:

           

          http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-March/018980.html

           

          http://blogs.msdn.com/ie/archive/2009/03/20/rtm-platform-changes.aspx


          Change your architecture of the requirement.


          -- Sunil Bhatia

          • 2. Re: File browse item with out saving in Database
            fac586

            Sunil Bhatia wrote:

             

            For security/privacy reasons recent versions of 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. Firefox, Safari and Chrome only provide the filename. IE6 & IE7 still yield the path in Windows format. IE8 and Opera have adopted an irritating approach of replacing the path with a wholly imaginary "C:\fakepath\".

             

             

            Changes to IE's security config can enable the path to be exposed in IE8, but I don't think it will be available via apex_application_files

             

             

            For more information see:

             

            http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-March/018980.html

             

            http://blogs.msdn.com/ie/archive/2009/03/20/rtm-platform-changes.aspx

             

            Change your architecture of the requirement.

             


            -- Sunil Bhatia

             

            Sunil

             

            It's OK for me to repost this response verbatim because I wrote it originally. It's not OK for you to do so without attribution or a link to the earlier post.


            What's worse is that you have plagiarised an old version and thus provided incorrect and out of date information. All current browsers now use the wholly unsatisfactory "C:\fakepath\" mechanism according to the HTML specification. Also on this occasion Jyo is looking to extract the filename rather than the path, which is possible.

            • 3. Re: File browse item with out saving in Database
              Sunil Bhatia

              Thanks FAC for highlighting, but i did not notice the author of it.

               

              I googled and found this earlier post helpful for the current post, so posted it for help.

               

              Thanks for reminding.

               

              - Sunil Bhatia

              • 4. Re: File browse item with out saving in Database
                fac586

                JyoInd123 wrote:

                 

                I am looking for a file select/browse option where i can select the file from a folder and view the file path. But i don't need to save the file to either 'WWV_FILES' or BLOB column. Is there any way we can acheive this?. Baiscally i need to extract the filename from the path and use for other processing. I don't need the file to be saved in the database. Can we achieve this in Apex?

                This looks like a continuation of the previous thread: Retrive full path shown in the file browse item? I hope the requirements are now clearer and realistically achievable.


                Extracting the filename rather than the path is possible. An example of a method for doing so is provided in the HTML specification for the file input type.


                In APEX, create a Before Page Submit dynamic action with 2 actions. In the first use an Execute JavaScript Code action to copy the filename from the file browse item to another page item using the method in the link above. In the second, apply a Disable action to the file browse item to prevent the file being uploaded with the submitted page.

                • 5. Re: File browse item with out saving in Database
                  fac586

                  Sunil Bhatia wrote:

                   

                  Thanks FAC for highlighting, but i did not notice the author of it.

                   

                  I googled and found this earlier post helpful for the current post, so posted it for help.

                   

                  Thanks for reminding.

                   

                  - Sunil Bhatia

                  If you find relevant information in a previous thread, post a link to it, or if including the information for context in your post, quote it by selecting the copied text and clicking the Quote Previous Message button in the editor.

                  • 6. Re: File browse item with out saving in Database
                    pkpanda

                    the solution to your question is create a directory object in the database.

                    e.g APPLICATION_FILE_LOAD  = C:\<application name > \<file upload> use the apex file browser to read the file into WWV_FLOW_FILES on submit create the file in APPLICATION_FILE_LOAD dir. So you can use a report to open the file.

                    • 7. Re: File browse item with out saving in Database
                      JJIN

                      Thanks....

                      • 8. Re: File browse item with out saving in Database
                        fac586

                        pkpanda wrote:

                         

                        the solution to your question is create a directory object in the database.

                        e.g APPLICATION_FILE_LOAD  = C:\<application name > \<file upload> use the apex file browser to read the file into WWV_FLOW_FILES on submit create the file in APPLICATION_FILE_LOAD dir. So you can use a report to open the file.

                        That would be the solution to a question that is the complete opposite of this one. For reasons that have not been made clear, the OP does not want the file in the database, nor on the DB server. Read the previous thread linked above.