Interact with Files in File Server

You can obtain a list of files, write or move a file to File Server, get the reference of a file and then stage read or unzip the file, and delete a file on File Server using the File server action.

What You Can Do with the File Server Action

The File server action lets you interact with files in the following ways.

For all of the options, you can hard code values, but most of the time, you'll pass dynamic values into the File server action using the Map action. Complete that task after you finish defining the File server action. See Next Steps.

Goal Operation to use Step-by-step instructions

Obtain a list of files in a File Server directory

List directory

  1. Start Here: Add the File Server Action to an Integration

  2. Option 1. Obtain a List of Files in File Server

Create a new file in a File Server directory

Write File

  1. Start Here: Add the File Server Action to an Integration

  2. Option 2. Write a File to File Server

Move a file from one File Server directory to another (similar to a cut and paste operation)

Move File

  1. Start Here: Add the File Server Action to an Integration

  2. Option 3. Move a File to File Server

Get a reference to a file in a File Server director, and use the reference to complete either of the following tasks:

  • Stage the file and then work with the staged file as needed in Oracle Integration

  • Write the file to another File Server directory

Get File Reference

  1. Start Here: Add the File Server Action to an Integration

  2. Option 4. Stage a File and Work with It, or Write a File to Another Location in File Server

Encrypt or decrypt a file

  • For files that must be encrypted and saved to File Server: Get File Reference, which gets a reference to a file.

    After the File server action, add a stage file action to encrypt the file, and then another File server action using the Write File operation. The File server action uploads the file to File Server by passing the encrypted file reference.

  • For encrypted files in File Server that must be decrypted: Get File Reference, which gets a reference to an encrypted file, followed by a stage file action to decrypt the file.

You can also use the capabilities of the FTP Adapter to encrypt or decrypt a file.

  1. Start Here: Add the File Server Action to an Integration

  2. Option 4. Stage a File and Work with It, or Write a File to Another Location in File Server

  3. Process Files in Schedule Integrations with a Stage File Action

  4. Option 2. Write a File to File Server

Alternatively, to use the FTP Adapter to encrypt or decrypt a file, see Create a Connection and Add the FTP Adapter Connection to an Integration in Using the FTP Adapter with Oracle Integration 3.

Sign or verify a file

You can perform signing using the private key to allow the receiver to verify that the file contents were not altered during transit. You can also perform signature verification using the public key on the incoming file to verify that the contents were not altered during transit.

  • For files that must be signed or verified and then saved to File Server: Get File Reference, which gets a reference to a file.

    After the File server action, add a stage file action to perform file signing or verification, and then another File server action using the Write File operation. The File server action uploads the file to File Server.

  • Alternatively, you can use the capabilities of the FTP Adapter to perform file signing or verification.

  1. Start Here: Add the File Server Action to an Integration

  2. Option 4. Stage a File and Work with It, or Write a File to Another Location in File Server

  3. Process Files in Schedule Integrations with a Stage File Action

  4. Option 2. Write a File to File Server

Alternatively, to use the FTP Adapter to perform file signing or verification, see Create a Connection and Add the FTP Adapter Connection to an Integration in Using the FTP Adapter with Oracle Integration 3.

Delete a file in a File Server directory

Delete File

  1. Start Here: Add the File Server Action to an Integration

  2. Option 5. Delete a File in File Server

When Not to Use the File Server Action

If you need to write a file to a temporary storage location and then perform work on the file, such as by updating the file, use a connection that is based on the FTP Adapter, or use the stage file action.

Start Here: Add the File Server Action to an Integration

No matter what you need to use the File server action to do, start here by adding the action to your integration.

  1. Add a File server action to an integration in either of the following ways:

    • On the side of the canvas, click Actions Integration actions icon and drag the File server action to the appropriate location.
    • Click Add icon at the location where you want to add the assign action, then select File server.

    Note:

    If you don't see the File server action or can't add it to an integration, then an administrator needs to enable File Server for your Oracle Integration instance. See Enable File Server in Using File Server in Oracle Integration 3.
  2. Fill in the following fields.

    Field Description
    What do you want to call your endpoint? Name of the endpoint, such as write_file_to_File_Server.
    Select resource

    Select one of the following options:

    • File: Interact with a file, such as by writing, moving, downloading, reading, or deleting it.

    • Directory: Obtain a list of files in a specific directory in File Server.

    Additional fields, which are related to the operation that you selected, appear.

  3. Continue following the steps in the appropriate section:

Option 1. Obtain a List of Files in File Server

  1. Complete the steps in Start Here: Add the File Server Action to an Integration.

  2. From the Select operation drop-down list, select List directory.

  3. Fill in the following fields.

    Field Description Can override later in the mapper?
    Input Directory

    Name of the directory that contains the files that you need to list. Oracle recommends using an absolute directory.

    For example, /HOME/USERS/.

    Yes
    File name pattern Pattern of the files that you want to list, such as *.csv for only CSV files. Or, enter * to list files of all types. Yes
    Max Files

    Maximum number of files to return, up to 1000.

    Note: The File server action returns the files according to the last modified time. If you selected 10 as the maximum number of files and the last modified time of the eleventh file is the same as the tenth file, then the action also returns the eleventh file and any other files with the same last modified time. For example, consider a directory with 15 files, and the Max Files setting is 10. If the tenth, eleventh, twelfth, and thirteenth files have the same time stamp, then the File server action returns thirteen files.

    No
    Minimum Age (seconds)

    Minimum age in seconds of the files to return.

    For example, if a file was last modified at 02:28:45 AM, and the minimum age is 80 seconds, the file isn't returned at 02:29:00 AM and 02:30:00 AM. The file is returned only after 02:30:05.

    No
    List File Recursively Whether to list files within directories recursively beneath the input directory. No
  4. Select Continue.

  5. Review the summary of the action, and select Finish.

The File server action appears on the canvas with a Map action before it.

Option 2. Write a File to File Server

  1. Complete the steps in Start Here: Add the File Server Action to an Integration.

  2. From the Select operation drop-down list, select Write File.

  3. Fill in the following fields.

    Field Description Can override later in the mapper?
    Specify an Output Directory

    Name of the directory to write the files to. Oracle recommends using an absolute directory.

    For example, /HOME/USERS/.

    Yes
    File Name Name of the file to create. Yes
  4. Select Continue.

  5. Review the summary of the action, and select Finish.

The File server action appears on the canvas with a Map action before it.

Option 3. Move a File to File Server

  1. Complete the steps in Start Here: Add the File Server Action to an Integration.

  2. From the Select operation drop-down list, select Move File.

  3. Fill in the following fields.

    Field Description Can override later in the mapper?
    Directory path

    Name of the directory that contains the file to be moved. Oracle recommends using an absolute directory.

    For example, /HOME/USERS/.

    Yes
    File name Name of the file to be moved. The file can be of any size. If the file is missing, an error occurs when the integration attempts to locate it. Yes
    Target directory path

    Name of the directory to move the file to. Oracle recommends using an absolute directory.

    For example, /HOME/USERS/.

    If the directory doesn't exist, File Server creates it.

    Yes
    Target file name Name of the file in the target directory. Yes
    Overwrite File

    When selected, the target file is overwritten if it already exists.

    If you deselect this option and the file already exists in the target directory, an error occurs when File Server attempts to move the file to the directory.

    No
  4. Select Continue.

  5. Review the summary of the action, and select Finish.

The File server action appears on the canvas with a Map action before it.

Option 4. Stage a File and Work with It, or Write a File to Another Location in File Server

This operation gets a reference to a file in File Server. If anyone moves or deletes the file while the integration is running, an error occurs, indicating that the file doesn't exist.

  1. Complete the steps in Start Here: Add the File Server Action to an Integration.

  2. From the Select operation drop-down list, select Get File Reference.

  3. Fill in the following fields.

    Field Description Can override later in the mapper?
    Input Directory

    Name of the directory that contains the files that you need to download. Oracle recommends using an absolute directory.

    For example, /HOME/USERS/.

    Yes
    File Name Name of the file in the input directory. Yes
  4. Select Continue.

  5. Review the summary of the action, and select Finish.

The File server action appears on the canvas with a Map action before it.

Option 5. Delete a File in File Server

  1. Complete the steps in Start Here: Add the File Server Action to an Integration.

  2. From the Select operation drop-down list, select Delete File.

  3. Fill in the following fields:

    Field Description Can override later in the mapper?
    Directory path

    Name of the directory to delete. Oracle recommends using an absolute directory.

    For example, /HOME/USERS/.

    Yes
    File name Name of the file to delete. Yes
  4. Select Continue.

  5. Review the summary of the action, and select Finish.

The File server action appears on the canvas with a Map action before it.

Note that the activity stream doesn't detect the file size, so the file size always appears as 0 in the activity stream for deleted files.

Next Steps