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

  • Creator
    Topic
  • #4105
    Anonymous

    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:

    http://www.advansyscorp.com/forums/topic/3354028312/

    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
    David

  • Author
    Replies
  • #7117
    MA
    Participant

    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))
    next

    #7116
    Support 1a
    Participant

    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

    #7114
    Anonymous

    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

    Dave

    #7115
    Support 1a
    Participant

    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:

    http://developer.novell.com/ndk/doc/gwobjapi/gwobjenu/data/hjwaqkjd.html

    Hope this helps,

    Advansys Support

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