Calculate attachment size when upload/update file

Description

we need to improve ad_attachment table with column store attachment size.

Use case: user open attachment select upload, select file, upload it
Action: idempiere calculates size of file and store it to ad_attachemnt.size column (must be specified well)

solution could help implementor to calculate file size for reporting purposes.

Environment

None

Activity

Show:
Tomáš Švikruha
November 4, 2014, 2:53 PM
  • Added column Size on AD_Attachment

  • Generated new X_ and I_ classes for AD_Attachment

  • Changed begoreSave method of MAttachment to set size in bytes

  • patch includes also migration scripts

Tomáš Švikruha
November 4, 2014, 2:56 PM

attached patch set size for newly created/updated files. There is a question how to update size on existing attachment records. I can create process which can recalculate existing attachments,but I don't know if it is best solution to create process for one time operation.

Norbert Bede
November 4, 2014, 3:15 PM

i think the solution could be a migration script.
IMHO: when admin run migration scripts calculates size for existing attachements.

Assignee

Tomáš Švikruha

Reporter

Norbert Bede

Labels

None

Tested By

None

Affects versions

Priority

Major
Configure