You are here: Appendix D: VBScript reference > The Meridian Enterprise events > AIMS_Attach_Intialize event

AIMS_Attach_Intialize event

Occurs after a user has invoked the Upload command in Meridian Explorer to upload a file but before the document is created in the vault. This event can be used to get the source filename and the URL parameters of the Meridian Explorer page. Its return values can be used to allow the upload to proceed and to specify the destination folder and document type or to cancel the operation.

This event is required for the Upload command. The command must be enabled as described in BlueCielo Meridian Explorer Administrator's Guide.

Function AIMS_Attach_Intialize (SourceFilename As String, QueryString As Array) As Array




The original filename that is uploaded from the client.


An array of name-value pairs for the URL parameters of the Meridian Explorer page.
Returned array
Value Description


Boolean True if the event should succeed, False if it should fail. If the event should fail, the upload is aborted and an error message should be returned as the second item in the array and the following items should not be returned.


The path of the target folder in the vault where the uploaded file should be stored.


The internal name of the document type that should be assigned to the new document.

' Event handler for BC-Explorer Asset Management Module link 
' Returns required input for the Upload function 
Function AIMS_Attach_Intialize(sourceFileName, queryString)
    Dim targetFolder 
    Dim docTypeName 

    ' Determine the target folder for the uploaded document
    Set targetFolder = Vault.RootFolder.GetSubFolder("Miscellaneous")
    If Not User.HasPrivilege(AS_PRIVILEGE_DOCUMENT_CREATE, targetFolder) Then
        ' Abort the upload
        AIMS_Attach_Intialize = Array(False, "Upload is not allowed")
        Exit Function
    End If
    ' Determine the document type for the uploaded folder
    docTypeName = "GenericDocument"
    If (LCase(Right(sourceFileName, 4)) = ".dwg") Then
        docTypeName = "Drawing"
    End If
    ' Return an array with the target folder path and the document type name
    AIMS_Attach_Intialize = Array(True, targetFolder.Path, docTypeName)
End Function

Related information

AIMS_Attach_Before event

AIMS_Attach_After event

AIMS_AddComment event

AIMS_CloseComment event

AIMS_DeleteComment event

AIMS_UpdateComment event