• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Oracle db: Get file size from BLOB datatype

LEGEND ,
Sep 26, 2017 Sep 26, 2017

Copy link to clipboard

Copied

Hello, all,

I've got a table in an Oracle 12g db that is BLOB for storing files.  I'm trying to find a way to get the size of a single file contained within the BLOB column.

I am not saving the file to the server before inserting it into the db; it is going straight to the db to cut down on disk i/o, so I can't get the file size before inserting.

Any thoughts?

V/r,

^ _ ^

TOPICS
Database access

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Sep 27, 2017 Sep 27, 2017

Nevermind.  This has become a non-issue.  Given the lack of activity on the Adobe forums, and pressing time to get things done, I have been forced into a rather hackish way of getting the information I require.  I am posting the solution below.

I am now using JavaScript "files" API to include the filesize with the filename during upload, delimited by a pipe (|), and am using REGEXP_SUBSTR() in the select query to distinguish between the filename and size for display purposes.

I hate doing it this

...

Votes

Translate

Translate
LEGEND ,
Sep 27, 2017 Sep 27, 2017

Copy link to clipboard

Copied

LATEST

Nevermind.  This has become a non-issue.  Given the lack of activity on the Adobe forums, and pressing time to get things done, I have been forced into a rather hackish way of getting the information I require.  I am posting the solution below.

I am now using JavaScript "files" API to include the filesize with the filename during upload, delimited by a pipe (|), and am using REGEXP_SUBSTR() in the select query to distinguish between the filename and size for display purposes.

I hate doing it this way, but don't have much choice as the project is launching on Monday.

V/r,

^ _ ^

var fileInput = document.getElementById('upload'), files = fileInput.files, fileName = files[0].size + "|" + files[0].name;

$('#fileName').val(fileName);

After upload:

SELECT REGEXP_SUBSTR(doc_name,'[^|]+',1,1) "DOC_SIZE", REGEXP_SUBSTR(doc_name,'[^|]+',1,2) "DOC_NAME"

FROM documents doc

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation