Filename Property


Value of "filename" field of the attachment headers. If "filename" field is not available, "name" field is returned. If both "filename" and "name" are missing, the property value is autogenerated (ATT<some-number>.<extension>). Extension is determined from the content-type.

To get the filename without autogeneration (so that empty name remains empty), use FilenameAsIs property.

Note: Filename (and FilenameAsIs) property always truncates path from original filename. E.g. if the attachment headers are: Content-Type: image/gif; name="_city_cat/030821xx.gif"

then Filename property will return "030821xx.gif".


Value Type: String
Parameters: None 
Remarks: This property is read-only

Usage example:

Dim Mailer, Msg, Attach
'Using visual basic to create object
Set Mailer = CreateObject("MailBee.POP3")
'Using ASP to create object
'Set Mailer = Server.CreateObject("MailBee.POP3")
'In ASP use Response.Write instead of MsgBox
Mailer.LicenseKey = "put your license key here"
Mailer.Connect "mailserver.com", 110, "MyName", "MyPassword"
If Mailer.Connected Then
  If Mailer.MessageCount > 0 Then
    Set Msg = Mailer.RetrieveSingleMessage(1)
    If Not Msg Is Nothing Then
      For Each Attach In Msg.Attachments
        MsgBox "Filename: " & Attach.Filename
      Next
    End If
  End If
  Mailer.Disconnect
End If

See Also:

ContentType Property
SaveFile Method
IsInline Property


Copyright © 2002-2022, AfterLogic Corporation. All rights reserved.