/ Forums / Advansys Formativ / Creating Solutions with Formativ / Reading Attachment Size onsend

  • Creator
  • #4105

    We have a problem in groupwise at the moment whereby zero byte files are not processed by the gwia and stay as pending. I’d like to create an applet that runs on onsend and checks the attachment size and if a zero byte file is encountered then stop the send action and warn the user.

    I’ve seen from previous examples how to move through the attachments:


    But I can’t find anything in the dev/ref manuals that refer to attachment size.

    Does anyone know if this can be done ?

    Kind Regards

  • Author
  • #7117

    The following code will read the attachments size for the composing message. Hope this helps.

    dim x

    for x = 0 to groupwise.ItemAttachmentGetCount(“X00”) -1
    ‘ Attachment size, in bytes of the specified file
    msgbox Utilities.FileSystem.GetSizeOfFile(groupwise.ItemAttachmentGetName(“X00”, x))

    Support 1a

    You should also ensure an attachment is a file before you attempt to determine its file size using this technique.

    Please note this method will only work with draft messages that have not yet been saved to Work in Progress.

    Advansys Support


    Cheers for that guys really appreciate your input. I can see how this works have you any sugestions how I can do this also for the draft messages.

    Thanks again, its def a big step forward


    Support 1a

    If you mean draft messages that have been saved into the Work in Progress folder, you would have to call the .Save method of the attachment object, then open the file to determine its size (slow and clunky).

    If you are using GroupWise 6.5 SP2 or greater, you can use the AttachmentSize property of the Attachment object.

    For more details see:


    Hope this helps,

    Advansys Support

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.