Skip to Main Content

ORDS, SODA & JSON in the Database

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!

ORDS upload document of any type

roryg18Oct 15 2018 — edited Oct 17 2018

Using 12c.

We're currently defining our endpoints in pl/sql and using pl/sql to parse the request bodies before doing any DML.

One thing we haven't been able to figure out is how to have a request body of binary and then parse that binary appropriately.

First thing we do in the ORDS endpoint source is grab the body;

declare

     l_body blob := :body;

begin

Specifically, what I need to do is get the file metadata before I add the blob to a table.

I would like to check the file size and make sure that mime type is what I expect it to be e.g. only allow .png, .jpeg and .doc. Nothing else.

Currently, we're using Ordimage.getProperties to get the metadata for images but have no luck finding something similar that would work for .pdf, .doc, .xls, etc, etc.

We've tried Orddoc but this doesn't appear to work correctly.

Would anyone have any suggestions of how documents (of any type) should be uploaded to ORDS so that they can be parsed and validated accordingly?

Comments

dvohra21

For Groovy expressions refer the different sections in "Introduction to Groovy Support in JDeveloper and Oracle ADF 11g".

Groovy expressions in ADF Business Components Entity Objects 

Referencing attributes in the same entity 

Referencing custom methods in the EntityImpl class  

Referencing base class methods in the EntityImpl class 

Using Groovy expressions in error messages 

Referencing attribtues in other entities 

Referencing built-in calls  

Groovy Expressions in ADF Business Components View Objects

Also refer "Groovy in ADF"

By Arda Erlap

and:

"Groovy Expression In ADF"

ORACLE ADF : Groovy Expression In ADF

1 - 1

Post Details

Added on Oct 15 2018
4 comments
1,925 views