AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkHttpConnection.GetFileASync Method (String, String, String)

Downloads an HTTP file from the server connected to using Connect and saves it to the location specified.

Syntax
Pascal
procedure GetFileASync(const ServerFile: String; const LocalFile: String; const PostData: String = ''); overload;
Parameters 
Description 
const ServerFile: String 
The file to request from the server, include everything after the domain part of the URL. 
const LocalFile: String 
The location to save to file. This will be inside the write folder for the current device. 
const PostData: String = '' 
(optional) The raw post data to send to the server. Note that & and = are special characters that separate variables. 

Also allows you to send POST data to the server which can include variables or file data, e.g. 'myvar=5&var2=test'. This method returns immediately and continues the file download in the background. 

You can check if download has completed with FileComplete. The file will then be at the location you specified ready for use with AGK. 

You can also check the download progress using FileProgress

There is also a version of GetFileASync that fires an event instead when the download has completed.

Copyright (c) 2012. All rights reserved.