Salesforce

File Management - Methods (Magic xpi 4.13)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

File Management – Methods

Use the following methods to configure the File Management component:

The following table lists the methods and parameters that can be used. Parameters in bold are mandatory.

Name

Parameters

Description

Append BLOB to File writes data into a new file, when there is no target file, or appends selected data at the end of an existing file by adding the contents of any BLOB or string.

Target File Name

Enter the full path and name of the file being appended.

Encoding

Enter the desired encoding of the data to be written to the file. The default value is Keep Existing.

The supported encoding values are Keep Existing, UTF-8 with BOM, UTF-8, Unicode, Ansi, Binary and Custom.

The runtime conversion will be done to the Data BLOB. See: Conversion Table

Since version: 4.7

Code Page

Enter the desired Code page value. It is mandatory to select the Code page when the Custom option is selected in the Encoding parameter.

The default Code page value is ibm-930_P120-1999

See: List of Supported Code Pages

Since version: 4.9

Data

Enter the data to be appended to the file.

Error Code

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Command Line scans executable files for commands.

Execute File Name

Enter the full path and name of the command being run.

Certain commands, for example del *.*, require user input. However, the Magic xpi Server works in background mode and therefore does not enable user input in the command line. Therefore, when using commands requiring user input, you should run the commands in quiet mode (/Q in Windows®).

In quiet mode, Magic xpi assumes that you wanted to use the default form of the command. For example, when you use the Delete command, the user would normally be asked whether to delete the file (Y/N). In quiet mode, Magic xpi therefore assumes the default form of the command, i.e. Y to delete the file.

To run the Delete command in quiet mode you should enter:

del /Q *.*

For IBM i (AS/400) computers, this method is not supported. Use the IBM i connector's

Run Command method instead.

Command Line Parameters

Enter a list of parameters for the command.

Timeout

Enter the time (in seconds) that the component will wait to execute the command before continuing to the next step.

Log File Location

Enter the full path and name of the log file for the command.

Return Code

Click to open the Variable List. Select a variable where the return code from the batch file execution is returned, and then click Select.

This functionality is only available for the Windows based platforms, and the Timeout parameter is set to 0.

Limitations:

  • When a batch file is invoked from another batch file, the invoked batch file must be specified with the absolute path or it should be kept in <XPI_INST>/Runtime folder.

  • The Command Line method of the File Management component returns an error code 1 instead of the actual value, when the batch file or the script file is non-existent.

Since version: 4.9

Error Code

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Copy File copies a file to a selected target.

From File Name

Enter the full path and name of the file to be copied.

To File Name

Enter the full path and name of the copied file's target.

If the target file exists, it is overwritten.

Error Code

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Copy Folder copies all files from the Source folder to the Destination folder.

Source Folder

The folder where you want to copy the files from.

Destination Folder

The folder where you want to copy the files to. If this folder does not exist, it will be created.

Copy Sub Folders

Select Yes if you want the component to copy subfolders.

Error Code

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Create File writes data into a new file.

Target File Name

Enter the full path and name of the file being created.

The file name can only contain English characters or characters from the language of your machine.

Encoding

Enter the desired encoding of the data to be written to the file. The default value is Keep Existing.

The supported encoding values are Keep Existing, UTF-8 with BOM, UTF-8, Unicode, Ansi, Binary and Custom.

The runtime conversion will be done to the Data BLOB. See: Conversion Table

Since version: 4.7

Code Page

Enter the desired Code page value. It is mandatory to select the Code page when the Custom option is selected in the Encoding parameter.

The default Code page value is ibm-930_P120-1999

See: List of Supported Code Pages

Since version: 4.9

Data

Enter the data to be included in the file being created.

Error Code

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

An error is sent if the target file exists.

Create Folder creates a new folder.

Folder Name

Enter the name of the folder to be created.

Error Code

Click to open the Variables List. Select a variable where the error is returned.

Delete File deletes a selected file.

File Name

Enter the name of the file to be deleted.

Error Code

Click to open the Variables List. Select a variable where the error is returned.

Delete Folder deletes a folder with all its files.

Folder Name

Enter the name of the folder to be deleted.

Error Code

Click to open the Variables List. Select a variable where the error is returned.

Log File creates or edits a log file in UTF-8 format with the contents of the Log Data String.

Log File Name

Enter the full path and name of the log file being created.

Log Data String

Enter the data to be sent to the Log Data String. This information is used to create or edit the log file.

Error Code

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Read File reads the data in a selected file.

From File Name

Enter the full path and name of the file being read.

Data

A data BLOB with the contents of the read file.

Error Code

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Read Folder reads the folder contents and returns a file containing file names with a separate row for each file name. Folder names will be prefixed with "\", such as: \Temp.

Folder Name

Enter the name of the folder to be read.

Include Sub Folders

Select Yes if you want the component to also read the subfolders' files.

Folder List

This BLOB contains files in the specified folder.

Error Code

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Rename File renames a selected file.

From File Name

Enter the full path and name of the file being moved to and renamed.

To File Name

Enter the full path and name of the renamed file's target.

Error Code

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

An error is sent if the target file exists.

Rename Folder renames the specified folder.

From Folder Name

Enter the name of the folder that you want to rename.

To Folder Name

Enter the name to give the folder that you are renaming. The new folder name must not exist. It cannot contain a new drive or path.

Error Code

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Write File writes to a selected file.

Target File Name

Enter the full path and name of the file receiving the data (that is being written).

Encoding

Enter the desired encoding of the data to be written to the file. The default value is Keep Existing.

The supported encoding values are Keep Existing, UTF-8 with BOM, UTF-8, Unicode, Ansi, Binary and Custom.

The runtime conversion will be done to the Data BLOB. See: Conversion Table

Since version: 4.7

Code Page

Enter the desired Code page value. It is mandatory to select the Code page when the Custom option is selected in the Encoding parameter.

The default Code page value is ibm-930_P120-1999

See: List of Supported Code Pages

Since version: 4.9

Data

Enter the data being written to the file.

A new file is created if the file does not exist. If the file exists, it is overwritten.

Error Code

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Related Topics

How to Use Direct Access Methods

Reference
Attachment 
Attachment