Skip to main content

File Link Command

The file link enables users to download various types of content from a webpage, including images, videos and documents. By using  this command, users can easily obtain the required file, allowing for convenient access and export of media and documents.

The screenshot below shows the simplest example where the File Link command can be used.

image-20241021-113801.png

In order to make the optimum use of the ‘File Link’ command, we can configure the options as can be observed in the snapshot, as per the user requirement.

image-20241021-113901.png

Command Configuration

The configuration screen for the URL command has three tabs viz. Browser, Options, and Text. Use the Browser tab to select command XPath and apply selection transformations. Use the ‘Options’ tab to set the command name and other command properties. Use the Text tab to navigate to the text of the agent where the command part is present.

image-20241021-113955.png

Command Properties

On the Options tab of the command, we have five options:

  1. General Settings

  2. File

  3. Error Handling

  4. Timeouts

image-20241021-114137.png

General Settings → General Command Settings

The ‘General command settings’ section is designed for user customization to give the command a desired name, comment to describe in brief about the usability or requirement for the command and the disabled option to not execute this command at all.

image-20241021-114243.png
  • Command name: This property specifies the name of the command.

  • Comments: Provides a field for entering metadata or a brief description regarding the command. These annotations are used internally to provide context for developers or team members. Comments are not part of the exported data and are only used for documentation purposes within the configuration.

  • Disabled:  This checkbox allows the user to disable the command. When checked, the command is ignored during execution. By default, it is unchecked.

When file link missing: This option specifies what happens if the selection does not exist in the current page. The drop-down provides the option to select the action to be performed when a selection is missing. The Default Value is “Warn”.

  • Fail:  It specifies if this selection does not exist in the current page then it Fails the agent from that command and doesn’t execute further.

  • Warn: It specifies if this selection does not exist in the current page then it ignores the current command as well as sub-commands and logs a Page Load error.

  • Ignore: It specifies if this selection does not exist in the current page then it ignores the current command as well as sub-commands.

  • Passthrough: It specifies if this selection does not exist in the current page then it ignores the current command, but executes sub-commands of the command.

Selected file link: This shows the content selected by the command on the current page. If no content is selected on the current page or a selection is missing on the current page, then it will show the below Message “No selected Content”.

image-20241021-114442.png

File → File name input

Here, you can set the name of the file using different available options. This feature allows you to personalize the file’s name, making it easier to recognize and manage. Customizing the file name helps improve organization and facilitates quick access later on.

  • File name: This option allows you to change the name of the file you’ve downloaded or entered by utilizing the various available options in the command. Here, you can specify the source from which you’re using the file. All the options are detailed below for your convenience, making it easy to customize your file name as needed. By default it is set to the Action Result.

    • Action Result: In Action Result option, you will simply specify the name of the file on the basis of the action result of the command. There are several options available in this settings which are explained below:

      • Captured File: This provides the name of the file along with its size displayed in square brackets. The Transformation option is also available for further customization.

      • Captured File Name: This simply returns the name of the captured file found on the website. The Transformation option is also available for further customization.

      • Is Error: This option returns false. You can also transform this option here. The Transformation option is also available for further customization.

      • Page Url: This provides the Page URL as the input for the data value command. The Transformation option is also available for further customization.

      • Page Url File Name: This provides the Page URL File Name  as the input for the data value command. The Transformation option is also available for further customization.

      • Return Code: This shows the status code for the command, indicating whether it was executed successfully. The Transformation option is also available for further customization.

  • Command: This option allows you to name the file using the Values of Parent commands. This feature provides flexibility in file naming, enabling you to create more relevant names based on existing Parent commands. Additionally, the Transform option is also available, allowing for further customization of the file name as needed.

  • Agent Parameter: This option enables you to assign a name to the file using the input parameters from the agent. By utilizing these parameters, you can create file names that are more specific and aligned with your needs. The Transform option is also available for additional customization, allowing you to tailor the file name further.

  • Static Value: This option allows you to freely specify the name of the downloaded file according to your preference. You have the flexibility to choose any name you like. Additionally, the Transform option is available for further customization if needed.

  • Script : This option allows you to assign a name to the downloaded file using script in any supported language, including Regex, JavaScript, C#, or Python. This flexibility enables you to create dynamic and context-specific file names based on your scripting needs.

  • Data List: This option allows you to name the file using data from the data list command. You can assign the specific column from which to derive the file name, ensuring relevance and clarity. The Transform option is also available here, providing additional customization for your file naming needs.

Error Handling

Please refer to the “Error Handling” section for more insight.

Timeouts  → File Download Timeouts

File Download Timeouts: This setting specifies the duration allowed for a file to download before the process is automatically terminated. Adjusting this timeout can help manage slow connections and prevent endless waiting periods, ensuring efficient file retrieval.

  • Timeout (seconds): This setting allows you to define the duration, in seconds, for which the file download will be attempted before it times out. If you set this value to zero, there will be no timeout, allowing the download to continue indefinitely until it completes. By default, the value is set to 0.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.