1 Reply Latest reply on Sep 2, 2010 2:36 AM by user9521786

    download  files from custom table

    541948
      Hello
      When you set up a functional on downloading files as here [Create Download Page for Embedded PL/SQL Gateway|http://download.oracle.com/docs/cd/E14373_01/appdev.32/e13363/up_dn_files.htm#CJAHDJDA]
      using the Embedded PL / SQL Gatevay everything works fine.
      Using apex listener browser appears the text
      "<html><body><h1>Internal Error</h1></body></html>"

      and in the log file error

      ** Found procedure in cache: f*** Total number of arguments: 15SID:139Parse: 1 ms
      -----
      begin
      f(p=>?);
      commit;
      end;

      *** Found procedure in cache: f*** Total number of arguments: 15p=100:501:1735071130713385::NO::P501_FILES4DOG_ID:27

      Exec: 291 ms31.08.2010 15:03:20 com.sun.grizzly.http.servlet.ServletAdapter doService
      SEVERE: service exception:
      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      at java.lang.String.substring(String.java:1949)
      at oracle.dbtools.apex.OWAResults.setHeaders(OWAResults.java:82)
      at oracle.dbtools.apex.OWAResults.<init>(OWAResults.java:27)
      at oracle.dbtools.apex.OWA.getPage(OWA.java:223)
      at oracle.dbtools.apex.ModApex.handleRequest(ModApex.java:180)
      at oracle.dbtools.apex.ModApex.doGet(ModApex.java:84)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at com.sun.grizzly.http.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:195)
      at com.sun.grizzly.http.servlet.FilterChainImpl.invokeFilterChain(FilterChainImpl.java:139)
      at com.sun.grizzly.http.servlet.ServletAdapter.doService(ServletAdapter.java:376)
      at ____bootstrap.SecureServletAdapter.doService(SecureServletAdapter.java:57)
      at com.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:324)
      at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
      at com.sun.grizzly.tcp.http11.GrizzlyAdapterChain.service(GrizzlyAdapterChain.java:180)
      at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
      at java.lang.Thread.run(Thread.java:636)


      The same error when using glassfish \ Tomcat.
      I run listener as
      java -Dapex.home=/home/print-srv/apex -Dapex.images=/home/print-srv/apex/i -Dapex.port=7080 -Dapex.erase -Dapex.debug.debugger=true -jar /home/print-srv/apex/apex.war

      APEX Listener version : 1.0.2.238.15.24
      APEX: 4.0.1
      Name for download procedure is download4you with grant execute for public. ( On Embedded work fine!)

      Anybody help me?
        • 1. Re: download  files from custom table
          user9521786
          Error find into procedure for downloading:

          htp.p ('Content-Disposition: attachment;filename="'||REPLACE (REPLACE (
          SUBSTR (v_filename, instr (v_filename, '/') + 1), chr (10), NULL), chr (13),


          I have CR ( line break) between "attachment;" and "filename=". This is error. After remove CR download files fine.