attachFileFromURL

Syntax

attachFileFromURL(fileUrl, pageId)

Description

Adds an attachment located on an URL path to a selected page.

Parameters

Parameter name

Type

Required

Description

fileUrl

string

Yes

URL path to the file.

pageId

numberYesThe ID of the selected page the file will be attached to.

Return type

boolean (true/false)

The return value represents the success of the attachment process. If the routine returns true the file was attached successfully.

Example

string url_to_file;
number page;
url_to_file = "http://otherServer/generateForm.aspx?PackageName=customField_10192";
page = 11801;
attachFileFromURL(url_to_file, page);

Result: Returns true if the file is at the selected location and the issue exists, meaning the file was attached. Returns false if any of the conditions stated before are not met.

Notes

If an error occurs, the routine will return false and the error message will be visible in the log.


See also