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?