Lasso Soft Inc. > Home

[HTTP_GetFile]

[HTTP_GetFile] downloads a named file from a remote HTTP server and creates a local file.

The -URL parameter is required to specify the name of the remote file to fetch. The -File parameter is required to specify the name of the local file to create. An optional -Username and -Password can be specified for authentication on the remote server. File permissions are required in order to create the file locally.

If the optional -Binary parameter is specified then the tag does not create a local file. Instead it returns the bytes of the downloaded file as the return value of the tag. The -File parameter is ignored if the -Binary parameter is specified.

  • Syntax
  • Parameters
[HTTP_GetFile: -URL='http://www.example.com/myfile.zip', -File='/folder/myfile.zip', -Username='Username', -Password='Password']

[HTTP_GetFile: -URL='http://www.example.com/myfile.zip', -Binary, -Username='Username', -Password='Password']
Required Parameters
-URL The URL folder from which the file will be downloaded.
-File The path to the local file to be created.
Optional Parameters
-Username Used to specifiy a username needed to log in to the remote HTTP server.
-Password Used to specifiy a password needed to log in to the remote HTTP server.
-Binary If the -Binary keyword is specified then the return type of the tag will be bytes.
Examples

To download a file from an HTTP server:

The following example downloads a file named download.zip from the URL http://www.example.com/download.zip to the local documents folder.

[HTTP_GetFile: -URL='http://www.example.com/download.zip', -File='/documents/download.zip']

To download a file from a password-protected HTTP server on a non-default port:

The following example downloads a file named download.zip at http://www.example.com:1024/private/download.zip where a username and password are required to access to the private folder.

[HTTP_GetFile: -URL='http://www.example.com:1024/private/download.zip', -File='/documents/download.zip', -Username='my_username', -Password='my_password']
Tag Link [HTTP_GetFile] Category Utility
Type Process Data Source Any
Support Preferred Version 6.0
Output Type None, Bytes Security File Tags
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft