Dani3lSun / apex-plugin-dropzone

Oracle APEX Region Plugin - Dropzone
MIT License
72 stars 19 forks source link

Accessing file size on complete #68

Closed mmacdonald1 closed 5 years ago

mmacdonald1 commented 5 years ago

Hi,

I apologize that this is not an issue but a general question.

So I know file size is available in the file added action, but how do I access file size on file complete to store in the database like your demo?

Dani3lSun commented 5 years ago

Hi @mmacdonald1 , for this you can use the dbms_lob.getlength database function, e.g.

SELECT c001 AS filename,
       c002 AS mime_type,
       d001 AS date_created,
       n001 AS file_id,
       blob001 AS file_content,
       dbms_lob.getlength(blob001) AS file_size_byte
  FROM apex_collections
 WHERE collection_name = 'DROPZONE_UPLOAD';