Maximo Open Forum

 View Only
  • 1.  How to Know the size of attachment sent through E-mail?

    Posted 06-20-2022 04:19
    Edited by Harshavardhan Kamepalli 06-20-2022 04:30
    Hi,
    We have an functionality of sending attachment through e-mail whenever an PO is approved. But when the attachments size is greater than 10 MB, the email is not sent because of the postfix attachment limit is '10 mb'.
    Now, I have an requirement to log these failed emails and to know the attachment size for each PO before sending an e-mail when approved.

    Is there any way to find these cases?
    #Administration
    #Customizations
    #Utilities

    ------------------------------
    Harshavardhan Kamepalli
    Accenture
    ------------------------------


  • 2.  RE: How to Know the size of attachment sent through E-mail?

    Posted 06-20-2022 04:39
    Hi Harsha Vardhan,
    I am not sure we can know the size of the Attachment, but default size of the Attachment is 10 Mb, and there is a property to increase the Attachment Size. In System Property-->mxe.doclink.maxfilesize.
    Note: if you made any changes in mxe.doclink.maxfilesize property then you have to restart the server.

    ------------------------------
    PAVAN KUMAR
    Maximo Consultant
    ------------------------------



  • 3.  RE: How to Know the size of attachment sent through E-mail?

    Posted 06-20-2022 09:04
    How are you getting the file to attach to the email? When I've done this in the past I was utilizing Automation Scripts and I'd have a Java file object that I interacted with. I never needed to check the length myself but you should be able to call .length() on the file to get its size in bytes. From there you could convert that into MB or whatever measurement you want.

    ------------------------------
    Steven Shull
    IBM
    ------------------------------



  • 4.  RE: How to Know the size of attachment sent through E-mail?

    Posted 06-23-2022 04:14
    Adding to want @Steven Shull has mentioned in his answer, the code should be something like the below. This is written for Asset Object Launch Point.

    from java.io import File

    path = mbo.getString("DOCLINKS.DOCINFO.URLNAME")
    print("The Path Value:",path)
    if (path):
    file = File(path)


    print("The Size of the File",file.length())
    print("The Size of the File in MB",file.length()/1024)
    print("The Size of the File in GB",file.length()/(1024 * 1024))


    ------------------------------
    Keshav Ravindran
    Bct
    ------------------------------