The saveAttachmentToFile function saves the content of an attachment, identified by a unique ID, to the specified file location. The function returns the absolute path of the new file with the attachment content.
Syntax
sFileName = saveAttachmentToFile(nAttachmentID, sFileDirName)
Arguments
Specifies a unique ID that identifies the attachment containing the desired content.
Full path and file name to the location where the file will be written.
If a file path is not provided, then the file will be written to the install_dir/server/c2o directory.
If a file is not specified, a unique file will be generated.
If only a path is specified, the path must include the path separator character at the end of the path (‘\’ for Windows or ‘/’ for UNIX).
Return Value
The full path to the file, including the file name, is returned if the function is successful. If the function fails, NULL is returned. The return type is C2OString.
Example
var i = Process.attachments[0].attachmentID; Process.save = saveAttachmentToFile( i, "attach.txt");
|
Copyright © 2014 CA.
All rights reserved.
|
|