1 Reply Latest reply: Sep 12, 2013 2:03 PM by AndyH RSS

    RESTful API - Can't Get Filename when POSTing?

    reggieh

      Hi,

       

      I've been trying to do an upload using a jquery Mutliple File upload directly through the APEX Listener so I can then be able to save the files as BLOB.  I'm able to do so, but the issue that I have is that I can't retrieve the "filename".

       

      Here is the info of my URI template:

       

      Method: POST

      Source Type: PL/SQL

      Requires Secure ACcess: No

       

      Source:

       

      declare

         l_id number;

      begin

         insert into table1 (mime, binary, filename) values (:contentType, :body, :my_file) returning id into l_id;

         commit;

      end;

       

      Parameters:

       

      (Name, Bind Variable Name, Access Method, Source Type, Parameter Type)

      filename, my_file, IN, HTTP Header, String

       

      The value in :my_file is always null. Does someone know why?

       

      If I can't get the exact filename, my guess would be to take the content disposition and parse it for 'filename="my_file.txt"', but when I try to use "Content-Disposition" as a parameter, I get null as well.

       

      I'm using APEX 4.2 with 11g. This is the info on my server:

       

      X-Powered-By: Servlet/3.0 JSP/2.2 (GlassFish Server Open Source Edition 3.1.2.2 Java/Oracle Corporation/1.7)

      Server: Oracle-Application-Express-Listener/2.0.3.221.10.13

       

      Thanks!

        • 1. Re: RESTful API - Can't Get Filename when POSTing?
          AndyH

          reggieh wrote:

          insert into table1 (mime, binary, filename) values (:contentType, :body, :my_file) returning id into l_id;

          Where does id come from?

           

          reggieh wrote:

           

          (Name, Bind Variable Name, Access Method, Source Type, Parameter Type)

          filename, my_file, IN, HTTP Header, String

           

          The value in :my_file is always null. Does someone know why?

           

          Are you sure that you are posting filename as a header string?