Cubic Compass Software

- Support Wiki

Dialogue Script : File Upload

Modified: 2009/01/05 00:07 by mleach - Categorized as: Dialogue Script
Syntax
<dlog:FileUpload id={unique control ID} target={Contact|Object|Account|RepositoryName|Folder} 
targetid={parent object} FolderName={directory name} FieldName={Salesforce URL field} Required={true|false} 
Searchable={true|false} ></dlog:FileUpload>

Usage
Uploads a document to the CMS and optionally updates a Salesforce URL field with a reference to the document. When Form Handler settings are configured in a Web-to-Lead or Web-to-Contact context, then the FieldName is assumed to be a Lead or Contact URL field. When Form Handler settings are configured to Create or Update a Salesforce record, then FieldName is assumed to be a URL field on the Salesforce object defined in the script editor (see drop down list 'Object Name' in editor).

Edit

Attributes


id: (Required) A unique identifier for the control. Multiple file upload controls may be used on a page, but each control control must have a unique ID.
Target: default='Contact'. The parent node within the portal object graph the Document binds to on upload. All Targets are object types except for 'Folder', which is a physical directory name. When 'Contact' is the defined Target with no TargetID, the parent is assumed to be the current user. When 'Object' is defined and an 'oid' parameter exists in the current page URL, the parent is assumed to be the current object. When 'Account' is the defined Target with no TargetID, the parent is assumed to be the current users Account. A document repository may be defined by name in the Target attribute.
TargetID: The specific parent object ID (Guid) defined by target. The 'Target' attribute is ignored when a specific TargetID is defined.
FolderName: Applicable when target='Folder'. Uploads the document to a specific folder. Note: this folder must physically be created using the CMS toolbar File Manager. An error will occur if the target folder does not physically exist.
FieldName: (Required) A Salesforce custom URL field name.
Required: (Optional) Default=false. Determines whether the document must be upload for the transaction to execute successfully.
Searchable: (Optional) Default=false. Determines whether the document is indexed and made available by search applications.


Example:
<dlog:FileUpload id="DocumentUploadID" Target="Contact" FieldName="UploadedDocument__c" Required="true" ></dlog:FileUpload>


Edit

Restricting File Types

You can restrict the FileUpload control to upload a file type. For example, to allow users to only upload images (Jpgs and Gifs) add a validator, which allows Gifs and Jpegs only.
<dlog:FileUpload id="DocumentUploadID" Target="Folder" FolderName="uploads" Required="true"></dlog:FileUpload>

<asp:RegularExpressionValidator
id="FileUpLoadValidator" ErrorMessage="Upload Jpegs and Gifs only."
ValidationExpression="^((a-zA-Z:)|(\\{2}\w+)\$?)(\\(\w\w.*))(.jpg|.JPG|.gif|.GIF)$"
ControlToValidate="DocumentUploadID">
</asp:RegularExpressionValidator>

ScrewTurn Wiki version 2.0.35. Some of the icons created by FamFamFam.