AI - Internet Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIC. - Artificial Intelligence Command > AI - Internet Commands >

AI - Internet Commands

AIC.Download File

Previous Top Next


MiniRobotLanguage (MRL)

 

AIC.Download File
Download a file from the Internet.

 

clip0608

 

Intention

 

The AIC.Download File command is a versatile command designed for downloading files from the internet using the HTTP protocol and saving them to a designated location on the local storage. It is not limited to images, and can be used to download any type of file including documents, archives, audio files, etc.

 

Syntax:

 

AIC.Download File|<URL>|<Path+Filename on local drive>

 

Parameters:

<URL>: The complete URL of the file that you want to download. It must start with http:// or https://.

 

<Path+Filename on local drive>: The path where you want to save the downloaded file along with the desired filename. The path should be valid and the filename should include the file extension (e.g., .pdf, .zip).

 

 

Example Usage:

 
AIC.Download File|https://example.com/document.pdf|C:/documents/myfile.pdf

 

In this example, the command will download the file from https://example.com/document.pdf and save it to C:/documents/ with the filename myfile.pdf.

 

Here is another example:

 

$$URL=https://www.smart-package.com/downloads/SPR_Silent_Setup.exe

$$PAT=?exeloc\

AIC.Download File|$$URL|$$PAT

ENR.

 

 

' Here is the same example, but the Filename is specified
$$URL=https://www.smart-package.com/downloads/SPR_Silent_Setup.exe

$$PAT=?exeloc\Silent_Setup.exe

AIC.Download File|$$URL|$$PAT

ENR.

 

 

Important Considerations:

Valid URL: Ensure that the URL is valid and is accessible. URLs that require authentication or are otherwise restricted may not work.

Storage Space: Make sure that there is sufficient storage space at the specified location for the file.

File Formats and Extensions: Ensure that the filename includes the correct file extension corresponding to the format of the file being downloaded.

Permissions: The specified path should be a location where the application has write permissions.

Security: Be cautious when downloading files from untrusted sources as they could contain malware or other security threats.

 

Note:

Please use this command responsibly and ensure that you have the rights to download and use the files. Be aware of copyright, licensing issues, and terms of use when downloading files from the internet. Also, be mindful of security and only download files from reputable sources.

 

 

Syntax

 

 

AIC.Download File|P1|P2

AIC.DLF|P1|P2

 

 

Parameter Explanation

 
P1 - URL: This parameter specifies the URL from which the file will be downloaded.

P2 - Filepath for the Downloaded File: This parameter specifies the local file path where the downloaded file should be saved.

       If the URL (P1) contains a valid filename, you have the option to omit the filename in this parameter. Instead, simply end the file path with a backslash "\".

       When the file path ends with a backslash, the filename from the URL will be used automatically.

P3 - Optional Flags: This parameter allows you to set optional flags to modify the download behavior.

       1: Download asynchronously without waiting. This means that the download will happen in the background, allowing the program to continue running without waiting for the download to complete.
           If the Script ends before the Download is completed, the download will be incomplete.

       2: Do not follow redirects. This means that if the URL redirects to another location, the download will not follow the redirect and will instead terminate.

 

 

Example

 

'*****************************************************

' EXAMPLE 1: AIC.-Commands

'*****************************************************

$$URL=https://www.smart-package.com/downloads/SPR_Silent_Setup.exe

$$PAT=?exeloc\

AIC.Download File|$$URL|$$PAT

ENR.

 

 

Remarks

-

 

Limitations:

Download Imagefile

 

 

See also:

 

  Set_Key

  Ask_Chat

  Ask_Completion