Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to extract PDF content in to a table in APEX and download in a page JSPX

3679263Mar 27 2018 — edited Mar 28 2018

Hi,

I am using a table having a BLOB column used to store a pdf document. The table was created in Oracle Apex. When I create a form on APEX,  I can upload files and download, insomuch as Apex provided automatically una URL to download the file. Now if I query the data base from the command line,I gives the text "[unsupported data type]" in the BLOB column space.

In my case I will not use a form, but an JSPX page for upload files. but the table to store the file it is create in APEX. I am using a java class to download the file. However I can not recover the file, blob column sends the following message [unsupported data type]. I using the sentencia PL/SQL (dbms_lob.getlength), bu this is retreiving the length the file. How can I do to retrieve the object and not the length from database?, if the blob column sends the following message [unsupported data type]. Is there a way to recover a file storing in a table Apex from JSPX page?.

           public void downloadBlobFile(FacesContext facesContext, OutputStream outputStream)

               {

                   Row row = getSolicitudRow("XxerComunicadosView1Iterator");

                   BlobDomain blob = (BlobDomain) row.getAttribute("Archivo");

                       try

                       { 

                          // copy the data from the blobDomain to the output stream

                           IOUtils.copy(blob.getInputStream(), outputStream);

                           blob.closeInputStream();

                           outputStream.flush();

                       }

                       catch (IOException e)

                       {

                           // handle errors

                           e.printStackTrace();

                           FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), "");

                           FacesContext.getCurrentInstance().addMessage(null, msg);

                       }

                  

               }

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 25 2018
Added on Mar 27 2018
3 comments
1,158 views