There is a field called "pyFileSize" in Data-WorkAttach-File class which I guess was planned to be built to hold the file size. However, unfortunately this property seems not to be used nor is there any functionality or API to obtain the file size.
Requirement is to get file size for all attachments and after much consideration I built an activity to call Oracle's DBMS_LOG package (GETLENGTH function) for pzPVStream column using CONNECT-SQL. However, the size is quite bigger than the actual size.. it varies but about 10%, sometimes more than 20%+. I need more accurate file size but how can I achieve this?
Please see attached for my code (DBMS_LOG package approach) and let me know if there is better approach.
First, in our application, file type is not limited to PDF but any kind.
Secondly, the solution referred to by the link is not limited to PDF but it applies to any file type. However, pyMaxDragDropAttachSizeMB is to LIMIT the uploaded file size but not to get the actual file size.
This solution is to limit the file upload when it exceeds the limit. I am trying to get the file size. Can you please take a look at the excel document that I attached to see how this solution fits into my code if this works.
I figured the solution. Once Data-WorkAttach-File is loaded, pyAttachStream is the Text type property that holds the file stream. So you can get the file size by @String.length(.pyAttachStream) * 3/4 (3/4 is required as Base 64 encode adds extra).
I have described the solution in detail in the attached below.