10 Replies Latest reply: Apr 1, 2013 8:00 AM by yshah RSS

    Upload document does not have correct file name

    yshah
      I have a procedure that uploads the file in the table with BLOB. We have a DAD entry on our application server as

      <Location /pls/excess_admin_qa>
      SetHandler pls_handler
      Order allow,deny
      Allow from All
      AllowOverride None
      PlsqlDatabaseConnectString 10.125.1.129:1521:sidq02 SIDFormat
      PlsqlAuthenticationMode Basic
      PlsqlDefaultPage eeq_main
      PlsqlDocumentTablename eeq_documents
      PlsqlDocumentProcedure eeq_attach_download
      # PlsqlAlwaysDescribeProcedure Off
      </Location>

      and I have another table in my application to connect the table to other ID's.

      It used ot work before, but noe it does not work. The file name should have prefix unique id like "F909307841/Blue hills.jpg", instead I get only C:/temp?Bluehills.jpg.
      The table structure is

      EEQ_DOCUMENTS
      (
      NAME VARCHAR2(128 BYTE),
      MIME_TYPE VARCHAR2(128 BYTE),
      DOC_SIZE NUMBER,
      DAD_CHARSET VARCHAR2(128 BYTE),
      LAST_UPDATED DATE,
      CONTENT_TYPE VARCHAR2(128 BYTE),
      CONTENT LONG RAW,
      BLOB_CONTENT BLOB
      }
      What could have cause this?
        • 1. Re: Upload document does not have correct file name
          APC
          yshah wrote:
          What could have cause this?
          A bug in your procedure.

          Are the files in C:\temp?

          * If yes, then your procedure is picking up the directory name somehow.
          * If no, then your procedure is hard-coding a directory name instead of generating a UID.

          But obviously, as the fault is in your code it is down to you to debug it.

          update

          I missed this bit:
          It used ot work before, but noe it does not work.
          So what changed? This is why Nature gave us source control and configuration management tools.

          Cheers, APC

          Edited by: APC on Mar 28, 2013 1:47 PM
          • 2. Re: Upload document does not have correct file name
            yshah
            No, it's not the procedure. The same procedure was working before.
            • 3. Re: Upload document does not have correct file name
              APC
              yshah wrote:
              No, it's not the procedure. The same procedure was working before.
              Then I repeat my question what has changed?

              Programs don't just stop working. Something has to have been changed. If it's not the actual procedure then it's something in the broader architecture: a function it calls, a configuration file, the values passed as parameters. It could be any number of things.

              We can't tell you what has changed, because we're not on your site, we can't see your development environment, we don't know your architecture.

              Please understand this. We often getting people posting questions along the lines of 'My program doesn't work any more: why? It used to work, it hasn't been changed'. Or the related one, 'My program works in environment A but doesn't work in environment B: why? They're both the same'.

              The answer always turns out to be: because something is different, something has changed. Or rather somebody has changed something. And it's not a Red Lectroid spawning from the Seventh Dimension to mess with your code.

              Good luck.

              Cheers, APC
              • 4. Re: Upload document does not have correct file name
                yshah
                I understand that. I was just wondering if anybody new where that unique id for the prefix for the file coming from? I am not sure our DBA has changed anything on the application server, but he said nothing has been changed in the environment.

                Thanks for your input
                • 5. Re: Upload document does not have correct file name
                  Paul  Horth
                  >
                  And it's not a Red Lectroid spawning from the Seventh Dimension to mess with your code.
                  >

                  And if it was, you'd just stick Buckaroo Banzai on the job.
                  • 6. Re: Upload document does not have correct file name
                    APC
                    Paul  Horth wrote:
                    And if it was, you'd just stick Buckaroo Banzai on the job.
                    +10cp

                    Cheers, APC
                    • 7. Re: Upload document does not have correct file name
                      fac586
                      yshah wrote:

                      It used ot work before, but noe it does not work. The file name should have prefix unique id like "F909307841/Blue hills.jpg", instead I get only C:/temp?Bluehills.jpg.

                      What could have cause this?
                      What browser is being used?

                      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. IE6 & IE7 still yield the path in Windows format. IE8+ adopted an irritating approach of replacing the path with a wholly imaginary "C:\fakepath\"—and this monstrosity has sadly had to be enshrined in the HTML5 spec so we're now saddled with this everywhere...

                      Changing IE's security config setting "Include local directory path when uploading files" enables the path to be exposed, which appears to be the most likely explanation for this.

                      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

                      http://developers.whatwg.org/number-state.html#file-upload-state
                      • 8. Re: Upload document does not have correct file name
                        yshah
                        Thanks. We are using IE8
                        • 9. Re: Upload document does not have correct file name
                          fac586
                          yshah wrote:
                          Thanks. We are using IE8
                          So is the "Include local directory path when uploading files" setting being used?
                          • 10. Re: Upload document does not have correct file name
                            yshah
                            Yes, the option is enabled, but this works in Porduction with same option.