An attachment field.

Namespace:  FreeFlow.Client
Assembly:  FreeFlow.Client (in FreeFlow.Client.dll) Version: 2.0.0.135

Syntax

C#
[SerializableAttribute]
public class AttachmentField : Field
Visual Basic (Declaration)
<SerializableAttribute> _
Public Class AttachmentField _
	Inherits Field
Visual C++
[SerializableAttribute]
public ref class AttachmentField : public Field

Examples

The following example shows how to attach a file to an attachment field on a form. This assumes the use of a HtmlInputFile ASP.NET control, but you could use any Stream-based data. The example assumes there is a map called 'Map1' with a creation action called 'First action' that uses a form with an attachment field called 'attach'.
CopyC#
Connection conn = new Connection(); 
ActionPage page = new ActionPage(); 
conn.Login("username", "password"); 
page.Connection = conn; 
page.StartBlankForm("Map1", "First action"); 
AttachmentField clip = page.Form.Field("attach") as AttachmentField; 

// uploadedFile is a HtmlInputFile control 
byte[] data = new byte[uploadedFile.PostedFile.InputStream.Length]; 
uploadedFile.PostedFile.InputStream.Read(data, 0, (int) uploadedFile.PostedFile.InputStream.Length); 

// get just the filename 
string fileName = uploadedFile.PostedFile.FileName; 
int indexOfSlash = fileName.LastIndexOf("\\"); 
clip.Value = fileName.Substring(indexOfSlash+1, fileName.Length-indexOfSlash-1); 

clip.Attachment = data; 

page.Submit();

Inheritance Hierarchy

System..::.Object
  FreeFlow.Client..::.Connectable
    FreeFlow.Client..::.Field
      FreeFlow.Client..::.AttachmentField

See Also