/ Forums / Advansys Formativ / Free Solutions from GroupWise Cool Solutions or Advansys / Warning user of attachment size they are sending

  • Creator
    Topic
  • #4520
    stephaniecartwright
    Participant

    Hello!

    We do not have a limit on the size of attachments we can send and receive, however, it is very common that the recipients will have a restriction.
    Is there an applet- or is it possible- that a user is warned that they are trying to attach a document that is over a certain size?
    Similar to the GroupWise message that appears when you view an attachment over a certain size…
    Thankyou!

  • Author
    Replies
  • #8315
    Support 1
    Participant

    Thank you for your enquiry.

    I am not aware of a solution for GroupWise which does what you describe. However, it should be possible to develop a Formativ or other solution which takes advantage of the AttachmentSize property of an attachment. This property is available with GroupWise 6.5.2 and later.

    If you are interested in custom development of a solution like this, please contact one of Advansys’ custom development partners.

    Regards,
    Advansys Support

    #8317
    djfield
    Participant

    Hi,

    Just so you know we hacked around the attachment checker example and came up with the code below. Its quick and dirty but it appears to do the job:

     
    '1000000 = 1mb, 20000000 = 20mb
    
    Const miWarnSize = 20000000
    
    sub Main(Client, GWEvent)
    
      Dim Msg
    
      Set Msg = GroupWise.ComposingItem
      if Msg is Nothing then
        on error resume next
        Set Msg = Client.ClientState.CommandMessage
        if not Msg is Nothing then
          CheckAttachments(Msg.MessageID)
        end if
      else
        CheckAttachments(Msg.MessageID)
      end if
      Set Msg = nothing
    
    end Sub
    
    Sub CheckAttachments(MessageID)
    
       Dim msName
       Dim msSize
    
       for x = 0 to groupwise.ItemAttachmentGetCount("X00") -1
          msName = groupwise.ItemAttachmentGetName("X00", x)
          if msName <> "" then
             Do Until InStr(1, msName, "") = 0
                  msName = Mid(msName, InStr(1, msName, "") + 1)
              Loop
          end if
          miSize = Utilities.FileSystem.GetSizeOfFile(groupwise.ItemAttachmentGetName("X00", x))
          msSize = cstr(round(miSize/1000000))
          if Utilities.FileSystem.GetSizeOfFile(groupwise.ItemAttachmentGetName("X00", x)) > miWarnSize then
             CancelSendDlg.CancelSendDlgLabel1.Caption = "The size of attachment " + msName + " is really large @ " + msSize + "mb are you sure you want to send it?"
             GroupWise.CancelGroupWiseEvent = CancelSend
          end if
       next
    
    end sub
    
    ' Ask the user if they want to cancel the sending of the item.  Return a boolean
    ' indicating if they wish to cancel or not.
    function CancelSend
      CancelSend = CancelSendDlg.ShowModal = MRCancel
    end function
    
     
    #8316
    Support 3
    Participant

    Great news and thanks for sharing the code.

    Regards,
    Advansys Support

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