An attachment field.
For a list of all members of this type, see AttachmentField Members.
System.Object
FreeFlow.Client.Connectable
FreeFlow.Client.Field
FreeFlow.Client.AttachmentField
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
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'.
[C#]
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();
Namespace: FreeFlow.Client
Assembly: FreeFlow.Client (in FreeFlow.Client.dll)
AttachmentField Members | FreeFlow.Client Namespace