This site is currently read-only as we are migrating to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 31st, when you will be able to use this site as normal.

    Forum Stats

  • 3,890,779 Users
  • 2,269,776 Discussions
  • 7,916,827 Comments

Discussions

File browse - granularity of maximum file size

Scott Wesley
Scott Wesley Systems Consultant & TrainerPerth, AustraliaMember Posts: 6,272 Gold Crown

Hi,

If I set a limit on the maximum file size property of a file browse item to 1900000/1024, this translates to a property of

data-max-file-size="1855.46875"

There are numerous sizes reports for a particular file in windows, but this appears to validate my file size base on the 'Size' value when viewing file properties

1899008/1024 is 1854 and succeeds.

1902080/1024 is 1857 and fails.

However, the client side validation message the appears on the page rounds to 2mb, with a message of:

File is too large. Maximum file size is 2 MB.

In our view this is significantly different to apparent size the user sees for the file.

Is there any way to give this message more granularity?

I suspect no, since this comes from displayFileSize() JS function in widget.fileBrowser.js, which would even round 1550 to 2mb.

This is in APEX 20.2

Scott

Answers

  • Scott Wesley
    Scott Wesley Systems Consultant & Trainer Perth, AustraliaMember Posts: 6,272 Gold Crown

    A workaround is to modify the message after it's displayed.

    Create a DA on change of the file browser item, then run this JavaScript

    if ($('#P5_FILE_error').text().substr(0,18) == 'File is too large.')
     $('#P5_FILE_error').text('&P5_LIMIT_SIZE_MSG.')
    

    Where the msg item is pre-calculated to display what I want

    I used the same mechanism to tidy the display of a File Types violation.

    InoL