Print this Page

ATTACHMENT Functions

Below is a listing of all the functions.

 

DeleteAttachment

DeleteAttachment

This method deletes an attachment.

 

Return Type: n/a

 

Name

Type

Description

AttachmentID

Integer

The ID of the attachment.

MessageID

Integer

The message ID the attachment belongs to.

UserID

Integer

The user ID who owns the attachments.

CategoryID

Integer

The category ID from where the attachment is being deleted (verifies permissions to delete the attachment).

ForumID

Integer

The forum ID the user belongs to.

AttachPath

Integer

The path to the attachment.

remove

Boolean

If you want to remove the attachment from the system or only the message it was attached to.

 

Examples

Visual Basic.Net

'Method DeleteAttachment

ftObj.DeleteAttachment(MessageAttachments(0).ID, MessageID, UserID, CategoryID, Forum.ID, ftObj.GetSettingFromStruct(Forum.Settings, "FTSET_FORUMSPATH").Value, False)

 

'Method DeleteAttachments

ftObj.DeleteAttachments(MessageID)

 

C#

//Method DeleteAttachment

ftObj.DeleteAttachment(MessageAttachments[0].ID, MessageID, UserID, CategoryID, Forum.ID, ftObj.GetSettingFromStruct(Forum.Settings, "FTSET_FORUMSPATH").Value, false);

 

//Method DeleteAttachments

ftObj.DeleteAttachments(MessageID);

 

DeleteAttachments

DeleteAttachments

This method deletes attachments for a specified message.

 

Return Type: n/a

 

Name

Type

Description

MessageID

Integer

The ID of the message the attachments belong to.

 

GetAttachmentsForUser

GetAttachmentsForUser

This method retrieves message attachments for a user.

 

Return Type:Attachment()

 

Name

Type

Description

UserID

Integer

The ID of the user to retrieve the attachments for.

 

Examples

Visual Basic.Net

'Method GetAttachmentsForUser

Dim UserAttachments As Attachment() = ftObj.GetAttachmentsForUser(UserID)

If Not UserAttachments Is Nothing Then

    For Each tmpAttachment In UserAttachments

        MsgBox(tmpAttachment.ID & ": " & tmpAttachment.FileName)

    Next

End If

 

C#

//Method GetAttachmentsForUser

FuseTalk.API.Attachment[] UserAttachments = ftObj.GetAttachmentsForUser(UserID);

if (UserAttachments != null)

{

foreach (FuseTalk.API.Attachment tmpAttachment in UserAttachments)

{

interaction.MsgBox(tmpAttachment.ID + ": " + tmpAttachment.FileName, 0, null);

}

}

 

Related Items

GetMessageAttachments
 

GetMessageAttachments

GetMessageAttachments

This method retrieves message attachments for a message.

 

Return Type:Attachment()

 

Name

Type

Description

MessageID

Integer

The ID of the message to retrieve the attachments for.

 

Examples

Visual Basic.Net

'Method GetMessageAttachments

Dim MessageAttachments As Attachment() = ftObj.GetMessageAttachments(MessageID)

If Not MessageAttachments Is Nothing Then

    For Each tmpAttachment In MessageAttachments

        MsgBox(tmpAttachment.ID & ": " & tmpAttachment.FileName)

    Next

End If

 

C#

//Method GetMessageAttachments

FuseTalk.API.Attachment[] MessageAttachments = ftObj.GetMessageAttachments(MessageID);

if (MessageAttachments != null)

{

foreach (FuseTalk.API.Attachment tmpAttachment in MessageAttachments)

{

interaction.MsgBox(tmpAttachment.ID + ": " + tmpAttachment.FileName, 0, null);

}

}

 

Related Items

GetAttachmentsForUser
 

InsertAttachment

InsertAttachment

Inserts an attachment into the database. This method will only perform the database actions necessary to attach a file to a message. It is assumed that the file is already in the attachment directory of the forum.

 

Return Type: n/a

 

Name

Type

Description

FileName

String

The filename for the attachment. This file must already exist in the FuseTalk attachment directory for the forum.

FileSize

Integer

The size of the file in bytes.

UserID

Integer

The ID of the user that owns the attachment.

MessageID

Integer

The ID of the message the attachment is tagged to.

 

Examples

Visual Basic.Net

'Method InsertAttachment

ftObj.InsertAttachment("file1.txt", 1024, UserID, MessageID)

ftObj.InsertAttachment("file2.txt", 1024, UserID, MessageID)

 

C#

//Method InsertAttachment

ftObj.InsertAttachment("file1.txt", 1024, UserID, MessageID);

ftObj.InsertAttachment("file2.txt", 1024, UserID, MessageID);