Commonly used for FTP retrieval, [curl->download] retrieves a file from the remote server and places it in the specified location.
Accepts either a string specifying the destination location of the downloaded file, or the -asBytes keyword which will return the contents of the downloaded file as bytes data for serving or other additional processing as required.
* This functionality was introduced in Lasso 9.2.6
curl->download('/download/filedownloaded.txt')
curl->download(-asBytes)
Use the [curl->download] method to retrieve the file and save it in the web server's local directory.
The destination server and path name of the source file are specified in the initialization of the curl object, as well as the username and password authentication.
Code
local(c = curl(
'ftp://server.com/path/to/file.txt',
-username='my_username',
-password='my_password'
)
)
#c->download('/download/filedownloaded.txt')
Result
The file is saved to disk at /download/filedownloaded.txt
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 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments