Home

News

Downloads

Forums

Notes

Readme

Links

Foro en Espaņol


ctl32_balloontip

ctl32_datepicker

ctl32_formstate

ctl32_ftp

ctl32_gripper

ctl32_monthcalendar

ctl32_progressbar

ctl32_scontainer

ctl32_statusbar

ctl32_trackbar


ctl32_ftp: overview | members


PEMs


FlagCacheAsync

Property

Allows a lazy cache write.

Value Type: Logical.

Default Value: .F.

Read/Write: Yes.

Remarks:

Related to the Cache.

Example:

See Also:

FlagCacheAsync | FlagCacheIfNetFail | FlagHyperLink | FlagNeedFile | FlagNoCacheWrite | FlagReload | FlagResynchronize


FlagCacheIfNetFail

Property

Returns the resource from the cache if the network request for the resource fails due to an ERROR_INTERNET_CONNECTION_RESET or ERROR_INTERNET_CANNOT_CONNECT error.

Value Type: Logical.

Default Value: .F.

Read/Write: Yes.

Remarks:

Related to the Cache.

Example:

See Also:

FlagCacheAsync | FlagCacheIfNetFail | FlagHyperLink | FlagNeedFile | FlagNoCacheWrite | FlagReload | FlagResynchronize


FlagHyperLink

Property

Forces a reload if there is no Expires time and no LastModified time returned from the server when determining whether to reload the item from the network.

Value Type: Logical.

Default Value: .F.

Read/Write: Yes.

Remarks:

Related to the Cache.

Example:

See Also:

FlagCacheAsync | FlagCacheIfNetFail | FlagHyperLink | FlagNeedFile | FlagNoCacheWrite | FlagReload | FlagResynchronize


FlagNeedFile

Property

Causes a temporary file to be created if the file cannot be cached.

Value Type: Logical.

Default Value: .F.

Read/Write: Yes.

Remarks:

Related to the Cache.

Example:

See Also:

FlagCacheAsync | FlagCacheIfNetFail | FlagHyperLink | FlagNeedFile | FlagNoCacheWrite | FlagReload | FlagResynchronize


FlagNoCacheWrite

Property

Does not add the returned entity to the cache.

Value Type: Logical.

Default Value: .F.

Read/Write: Yes.

Remarks:

If the application makes changes on the FTP server or if the FTP server changes frequently, the INTERNET_FLAG_NO_CACHE_WRITE and INTERNET_FLAG_RELOAD flags should be set in FtpFindFirstFile. These flags ensure that the directory information being retrieved from the FTP server is current.

Related to the Cache.

Example:

See Also:

FlagCacheAsync | FlagCacheIfNetFail | FlagHyperLink | FlagNeedFile | FlagNoCacheWrite | FlagReload | FlagResynchronize


FlagPassive

Property

Uses passive FTP semantics.

Value Type: Logical.

Default Value: .F.

Read/Write: Yes.

Remarks:

Used by: ctlOpen

Used by Windows API: Only InternetConnect and InternetOpenUrl use this flag. InternetConnect uses this flag for FTP requests, and InternetOpenUrl uses this flag for FTP files and directories.

http://msdn2.microsoft.com/en-us/library/aa383661.aspx

Example:

See Also:


FlagReload

Property

Forces a download of the requested file, object, or directory listing from the origin server, not from the cache.

Value Type: Logical.

Default Value: .F.

Read/Write: Yes.

Remarks:

If the application makes changes on the FTP server or if the FTP server changes frequently, the INTERNET_FLAG_NO_CACHE_WRITE and INTERNET_FLAG_RELOAD flags should be set in FtpFindFirstFile. These flags ensure that the directory information being retrieved from the FTP server is current.

Used by: ctlFtpDirToArray, ctlFtpDirToCursor, ctlFtpGetFile

Used by Windows API: GopherFindFirstFile, GopherOpenFile, FtpFindFirstFile, FtpGetFile, FtpOpenFile, FtpPutFile, HttpOpenRequest, and InternetOpenUrl

http://msdn2.microsoft.com/en-us/library/aa383661.aspx

Example:

See Also:

FlagCacheAsync | FlagCacheIfNetFail | FlagHyperLink | FlagNeedFile | FlagNoCacheWrite | FlagReload | FlagResynchronize


FlagResynchronize

Property

Reloads HTTP resources if the resource has been modified since the last time it was downloaded. All FTP and Gopher resources are reloaded.

Value Type: Logical.

Default Value: .F.

Read/Write: Yes.

Remarks:

Used by: ctlFtpDirToArray, ctlFtpDirToCursor, ctlFtpGetFile

Used by Windows API: GopherFindFirstFile, GopherOpenFile, FtpFindFirstFile, FtpGetFile, FtpOpenFile, FtpPutFile, HttpOpenRequest, and InternetOpenUrl

http://msdn2.microsoft.com/en-us/library/aa383661.aspx

Example:

See Also:

FlagCacheAsync | FlagCacheIfNetFail | FlagHyperLink | FlagNeedFile | FlagNoCacheWrite | FlagReload | FlagResynchronize


FlagTransferBinary

Property

If TRUE, transfers files as binary. If FALSE, transfers files as ASCII.

Value Type: Logical.

Default Value: .T.

Read/Write: Yes.

Remarks:

Example:

See Also:


FormatBytes(nBytes)

Method

Returns a string with the properly formatted value of nBytes.

Parameters

nBytes

Specifies a numeric expression in bytes.

Return Value:

Character.  Returns a string representing the number of bytes in Bytes, KB, MB or GB.

Remarks:

Useful for updating a label that displays download status.

See Also:


FormatSeconds(nSeconds)

Method

Returns a string with the properly formatted value of nSeconds in HH:MM:SS.

Parameters

nSeconds

Specifies a numeric expression in seconds

Return Value:

Character.  Returns a string representing the number of seconds like 00:00:00.

Remarks:

Useful for updating a label that displays download status.

See Also:


FtpAddFS(cFtpPath)

Method

Adds a forward slash to an FTP path, if needed

Parameters

cFtpPath

Specifies a character espression that representes a path.

Return Value:

Character.

Remarks:

Works just like the Addbs() VFP function, but for FTP paths.

See Also:


FtpCancel()

Method

Sets the FtpTransferCancelled property value to TRUE, cancelling an ongoing FtpReadFile or FtpWriteFile.

Return Value:

None.

Remarks:

This method sets FtpTransferCancelled to TRUE. If there is an ongoing FtpReadFile/FtpWriteFile, it will be cancelled and the already downloaded/uploaded data will be erased.

This method can be used to allow the user to cancel a long FTP download/upload.

See Also:


FtpClose()

Method

Closes a connection opened with the FtpOpen method.

Return Value:

Boolean. Always returns TRUE.

Remarks:

This method encapsulates the InternetCloseHandle API function.

See Also:


FtpCommand(cCommand, [lExpectResponse])

Method

Sends commands directly to an FTP server.

Parameters

cCommand

Character expression that specifies the command to send to the FTP server.

lExpectResponse

Optional logical expression that specifies if a response is expected. This means that a handle will be obtained.

Return Value:

Boolean.  Returns TRUE if successful, or FALSE otherwise. If lExpectResponse is set to TRUE and the return value is TRUE, the handle to the FtpCommand is stored in the hFtpCommand property.

Remarks:

The cCommand parameter contains the command to send to the FTP server.

lExpectResponse: a boolean value that indicates whether the application expects a data connection to be established by the FTP server. This must be TRUE if a data connection is expected, or FALSE otherwise.

This method encapsulates the FtpCommand API function.

Flags that modify the behaviour of this method:

FtpFlagTransferBinary

See Also:


FtpCreateDirectory(cDirectory)

Method

Creates a new directory on the FTP server.

Parameters

cDirectory

Character expression that specifies the name of the directory to create.

Return Value:

Boolean.  Returns TRUE if successful, or FALSE otherwise.

Remarks:

The cDirectory parameter is the name of the directory to be created. This can be either a fully qualified path or a name relative to the current directory.

This method encapsulates the FtpCreateDirectory API function.

See Also:


FtpDeleteFile(cRemoteFile)

Method

Deletes a file stored on the FTP server.

Parameters

cRemoteFile

Character expression that specifies the name of the file to delete.

Return Value:

Boolean.  Returns TRUE if successful, or FALSE otherwise.

Remarks:

The cFile parameter can be either a partially or fully qualified file name relative to the current directory.

This method encapsulates the FtpCreateDirectory API function.

See Also:


FtpDirToArray([cFileSkeleton])

Method

Places information about files in the FTP server into an array and returns the number of files and directories that match the file skeleton.

Parameters

cFileSkeleton

Optional character expression that specifies the file skeleton to use, for example: "*.*" or "*.txt"

Return Value:

Numeric. The number of files and directories found. Returns -1 if it fails.

Remarks:

cFileSkeleton can include a path and wildcards in the file name, for example: "/myfiles/*.txt"

If the file skeleton does not include a path, the current FTP directory is used.

If no parameter is passed, the current FTP directory is used, with a *.* file mask.

The array will have one extra row at the top, with a file name of ".." and the current date and time. This row refers to the parent directory. The number of rows will be equal to the number of files in the current FTP directory + 1.

The array used is a property of the class: FtpFiles. The contents of the array are the same as the VFP Adir function, but the full path and file name instead of just the filename:

Column Array contents Data type
1 File path and name Character
2 File size Numeric
3 Date last modified Date
4 Time last modified Character
5 File attributes (RASHD) Character

There are more file properties available to be used, see the _AddToArray method of the class.

This method encapsulates the FtpFindFirstFile and InternetFindNextFile API functions.

See Also:


FtpDirToCursor(cCursorName, [cFileSkeleton])

Method

Places information about files in the FTP server into a cursor and returns the number of files and directories.

Parameteres

cCursorName

Character expression that specifies the name of the cursor to create.

cFileSkeleton

Optional character expression that specifies the file skeleton to use, for example: "*.*" or "*.txt"

Return Value:

Numeric. The number of files and directories found.

Remarks:

The first record will be a reference to ".." see ctlFtpDirToArray for more info.

The cursor structure is similar to that of the array returned by FtpDirToArray. The name of the fields are:

f_name

f_size

f_date

f_time

f_attr

See Also:


FtpErrorCode

Property

Specifies the last error code as reported by the API functions.

Value Type: Numeric.

Default Value: 0

Read/Write: Read only.

Remarks:

This value can be checked when a method of the class returns FALSE.

Example:

See Also:


FtpErrorFunction

Property

Specifies the name of the API function that generated the last error.

Value Type: Character.

Default Value: None

Read/Write: Read only.

Remarks:

This value can be checked when a method of the class returns FALSE.

Example:

See Also:


FtpErrorText

Property

Specifies the last error text as reported by the API functions.

Value Type: Character.

Default Value: None

Read/Write: Read only.

Remarks:

This value can be checked when a method of the class returns FALSE.

Example:

See Also:


FtpFileData

Property

Stores a remote file contents when the FtpReadFile method is used nad a local file name is not specified..

Value Type: Character.

Default Value: None

Read/Write: Read only.

Remarks:

This property can hold up to 16711680 bytes of data, the VFP limit for character variables. If the remote file size is bigger than 16711680 bytes, FtpReadFile will return FALSE, but the first 16711680 bytes will be saved in FtpFileData.

Example:

See Also:


FtpFileInfo

Property

FtpFileInfo is an object that holds information about a file in the FTP server.

Value Type: Object.

Default Value: None

Read/Write: Read only.

Remarks:

When you call the FtpGetFileInfo(cFileName) method, the information about the file is stored in this object.

FtpFileInfo Properties:

FileAttributes * Numeric.
FileAttributeArchive Logical.
FileAttributeCompressed Logical.
FileAttributeDirectory * Logical.
FileAttributeEncrypted Logical.
FileAttributeHidden Logical.
FileAttributeNormal * Logical.
FileAttributeNotContentIndexed Logical.
FileAttributeOffline Logical.
FileAttributeReadOnly Logical.
FileAttributeReparsePoint Logical.
FileAttributeSparseFile Logical.
FileAttributeSystem Logical.
FileAttributeTemporary Logical.
FileAttributeVirtual Logical.
FileCreationTime DateTime.
FileLastAccessTime DateTime.
FileLastWriteTime * DateTime.
FileName * Character.
FilePath * Character.
FileShortName Character.
FileSize * Numeric.
Adir1 Character. File Path and Name. Used by FtpDirToArray.
Adir2 Numeric. File Size. Used by FtpDirToArray.
Adir3 Date. Date last modified. Used by FtpDirToArray.
Adir4 Character. Time last modified. Used by FtpDirToArray.
Adir5 Character. Attibutes RASHD. Used by FtpDirToArray.

* It seems that only these properties have any data for most FTP servers.

Example:

See Also:


FtpFiles(x,5)

Property

This property holds the array created by FtpDirtoArray or FtpdirToCursor

Value Type:

Default Value: None

Read/Write: Read only.

Remarks:

This array is similar to the array created by the ADIR native VFP function.

Column Array contents Data type
1 File names Character
2 File sizes Numeric
3 Dates last modified Date
4 Times last modified Character
5 File attributes (RASHD) Character

When you call the FtpDirToArray method, it places information about the files in the FtpFiles array. FtpDirToArray returns the number of files found. FtpFiles will allways have one more row that the value returned by FtpDirToArray.

The first row will always contain a reference to the parent directory:

Column Contents
1 ".."
2 0
3 Date()
4 This.FormatSeconds(Seconds())
5 "....D"

So if there are no files returned by FtpDirToArray, FtpFIles will contain only one row.

Example:

See Also:


FtpGetCurrentDirectory(@cDirectory)

Method

Retrieves the current directory for the active FTP session.

Parameters

cDirectory

Character expression passed by reference that specifies the name of the current directory.

Return Value:

Boolean.  Returns TRUE if successful, or FALSE otherwise.

The value of the current FTP directory is saved in the cDirectory parameter passed by reference if the functions suceeds, otherwise, it will be empty.

Remarks:

This method encapsulates the FtpGetCurrentDirectory API function.

See Also:


FtpGetFile(cRemoteFile, cLocalFile, [lOverwrite], [nAttributes])

Method

Retrieves a file from the FTP server and stores it under the specified file name, creating a new local file in the process.

Parameters

cRemoteFile

Character expression that specifies the name of the remote file to download

cLocalFile

Character expression that specifies the name of the local file to create/overwrite

lOverwrite

Logical expression that specifies if an existing local file should be overwritten. if this parameter is not specified and Set Safety is OFF, an existing local file will be overwritten.

nAttributes

Numeric expression that specify attributes for the local file. See http://msdn2.microsoft.com:80/en-us/library/aa363858.aspx for possible attributes, or just set this parameter to 0.

Return Value:

Boolean.  Returns TRUE if successful, or FALSE otherwise.

Remarks:

This method encapsulates the FtpGetFile API function. This method blocks the VFP program until the download is finished, use it only for small files, or use FtpReadFile.

Flags that modify the behaviour of this method:

FtpFlagHyperLink

FtpFlagNeedFile

FtpFlagReload

FtpFlagResynchronize

FtpFlagTransferBinary

See Also:


FtpGetFileInfo(cRemoteFile)

Method

Places file/directory info in the FtpFileInfo object

Parameters

cRemoteFile

Character expression that specifies the name of a file or directory.

Return Value:

Boolean.  Returns TRUE if successful, or FALSE otherwise.

Remarks:

This method encapsulates the FtpgetFile API function.

See Also:


FtpGetFileSize(cRemoteFile)

Method

Returns the size of the specified file

Parameters

cRemoteFile

Character expression that specifies the name of a file.

Return Value:

Numeric. Returns the size of the remote file, or -1 if the function fails.

Remarks:

Since the FtpGetFileSize API function only works for files up to 4GB, this method sends a SIZE command to the FTP server.

See Also:


FtpOpen( cURL)

Method

Opens an FTP session for a given site.

Parameters

cUrl

Return Value:

Boolean.  Returns TRUE if successful, or FALSE otherwise.

Remarks:

If cURL does not include a protocol (http://; https://; ftp://) the class will default to ftp://. You can specify a user name, a password, and a non-default port in the URL

Only one session can be opened at a time. Opening a new session will close any previous opened session.

This method encapsulates the InternetOpen and InternetConnect API functions.

Alternatively, you can specify a username and a password using the FtpUsername and FtpPassword properties, for example in cases when either of them contain the "@" or ":" characters.

Example:

.ctlOpen("ftp://username:password@ftp.example.com:22")

 

.ctlOpen("192.168.0.100")    && Defaults to ftp protocol, port 21, user name "anonymous"

See Also:

ctlClose | ctlDisconnect | ctlOpen


FtpPassword

Property

Specifies the password to use to log on. If both FtpPassword and FtpUserName are empty, the function uses the default "anonymous" password. In the case of FTP, the default password is the user's e-mail name. If FtpPassword is empty, but FtpUserName is not empty, the function uses a blank password.

Value Type: Character.

Default Value: ""

Read/Write: Yes.

Remarks:

If you specify a password in the URL passed to ctlOpen, that password will be used instead. The value if this property will NOT be updated with the value of the password passed to ctlOpen.

ctlUserName

ctlPassword

User name sent to FTP server

Password sent to FTP server

empty empty "anonymous" User's e-mail name
Non-NULL string empty ctlUserName ""
empty Non-empty string ERROR ERROR
Non-empty string Non-empty string ctlUserName ctlPassword

Example:

See Also:


FtpPause()

Method

Sets the FtpTransferPaused property value to TRUE.

Return Value:

None.

Remarks:

This method sets FtpTransferPaused to TRUE. If there is an ongoing FtpReadFile/FtpWirteFile, it will be paused and the already downloaded/uploaded data will be kept.

This method can be used to allow the user to pause a long FTP download/upload.

See Also:


FtpPutFile(cLocalFile, cRemoteFile)

Method

Stores a file on the FTP server.

Parameters

cLocalFile

Character expression that specifies the name of the local file to upload

cRemoteFile

Character expression that specifies the name of the remote file to upload to.

Return Value:

Boolean.  Returns TRUE if successful, or FALSE otherwise.

Remarks:

This method encapsulates the FtpPutFile API function. This method blocks the VFP program until the upload is finished, use it only for small files, or use FtpWriteFile.

Flags that modify the behaviour of this method:

FtpFlagHyperLink

FtpFlagNeedFile

FtpFlagReload

FtpFlagResynchronize

FtpFlagTransferBinary

See Also:


FtpReadFile(cRemoteFile, [cLocalFile])

Method

Retrieves a file from the FTP server and stores it under the specified file name, creating a new local file in the process.

Parameters

cRemoteFile

Character expression that specifies the name of the remote file to download

cLocalFile

Character expression that specifies the name of the local file to create/overwrite. If no local file name is specified, the downloaded data will be saved in the FtpFile

Return Value:

Boolean.  Returns TRUE if successful, or FALSE otherwise.

Remarks:

This method does not block the VFP program, and allows the display of progress information to the user. See the FtpTransferStart, FtpTransfer and FtpTransferEnd events.

This method encapsulates the FtpOpenFile, InternetReadFile API functions.

Flags that modify the behaviour of this method:

FtpFlagHyperLink

FtpFlagNeedFile

FtpFlagReload

FtpFlagResynchronize

FtpFlagTransferBinary

See Also:


FtpReadUrl(cUrl, cLocalFile)

Method

This method just calls FtpOpen, FtpReadFile, and FtpClose in one step.

Parameters

cUrl

Character expression that specifies the name of the remote file to download

cLocalFile

Character expression that specifies the name of the local file.

Return Value:

Boolean.  Returns TRUE if successful, or FALSE otherwise.

Remarks:

This method does not block the VFP program, and allows the display of progress information to the user. See the FtpTransferStart, FtpTransfer and FtpTransferEnd events.

This method encapsulates the FtpOpenFile, InternetReadFile API functions.

Flags that modify the behaviour of this method:

FtpFlagHyperLink

FtpFlagNeedFile

FtpFlagReload

FtpFlagResynchronize

FtpFlagTransferBinary

See Also:


FtpRemoveDirectory(cDirectory)

Method

Removes the specified directory on the FTP server.

Parameters

cDirectory

Character expression that specifies the name of the directory to delete.

Return Value:

Boolean.  Returns TRUE if successful, or FALSE otherwise.

Remarks:

cDirectory contains the name of the directory to be removed. This can be either a fully qualified path or a name relative to the current directory.

This method encapsulates the FtpRemoveDirectory API function.

See Also:


FtpRenameFile(cOldFileName, cNewFileName)

Method

Removes the specified directory on the FTP server.

cOldFileName

Character expression that specifies the name of the file to be renamed.

cNewFileName

Character expression that specifies the new name for the remote file.

Return Value:

Boolean.  Returns TRUE if successful, or FALSE otherwise.

Remarks:

This method encapsulates the FtpRenameFile API function.

See Also:


FtpResponse

Event

This method fires every time the FtpResponseText is updated, can be used to update a response log.


FtpResponseCode

Property

Specifies the last response code returned by the FTP server.

Value Type: Numeric.

Default Value: 0

Read/Write: Read only.

Remarks:

Example:

See Also:


FtpResponseFunction

Property

Specifies the name of the function that triggered the last response from the server.

Value Type: Character.

Default Value: NONE

Read/Write: Read only.

Remarks:

Example:

See Also:


FtpResponseText

Property

Specifies the last response text from the FTP server.

Value Type: Character.

Default Value: None

Read/Write: Read only.

Remarks:

Example:

See Also:


FtpSetCurrentDirectory(cDirectory)

Method

Changes to a different working directory on the FTP server.

Parameters

cDirectory

Character expression that specifies the name of the directory to become the current working directory. This can be either a fully qualified path or a name relative to the current directory.

Return Value:

Boolean.  Returns TRUE if successful, or FALSE otherwise.

Remarks:

This method encapsulates the FtpSetCurrentDirectory API function.

See Also:


FtpTransfer

Event

Occurs after an FtpReadFile/FtpWriteFile method reads/writes a file chunk. Use it to update download/upload status.


FtpTransferCancelled

Property

Indicates if a FtpReadFile/FtpWriteFile method was cancelled.

Value Type: Logical.

Default Value: FALSE

Read/Write: Read only.

Remarks:

The value of this property can be checked if FtpReadFile/FtpWriteFile returns FALSE, to know if the user cancelled the download.

Example:

See Also:


FtpTransferEnd

Event

Occurs after an FtpReadFile/FtpWriteFile method ends.


FtpTransferInfo

Property

This property holds an object reference to a FtpTransferInfo object, that stores information about the current ongoing download/upload.

Value Type: Logical.

Default Value: FALSE

Read/Write: Read only.

Remarks:

This object is used instead of passing a large number of parameters to the FtpTransferStart, FtpTransfer and FtpTransferEnd events.

FtpTransferInfo properties:

FtpRemoteFile

Downloads: Character, name of the remote file being downloaded.

Uploads: Character, name of the remote destination file.

FtpBytesTotal

Downloads: Numeric, size in bytes of the remote file.

Uploads: Numeric, size in bytes of the local file.

FtpBytesComplete

Numeric, indicates how many bytes have already been downloaded/uploaded.

FtpBytesLeft

Numeric, indicates how many bytes are still left to download/upload.

FtpBytesSpeed

Numeric, indicates the average download/upload speed in bytes per second.

FtpTimeTotal

Numeric, indicates in seconds the estimated total download/upload time, based on the average download/upload speed.

FtpTimeElapsed

Numeric, indicates in seconds the elapsed time since the download/upload started.

FtpTimeLeft

Numeric, indicates in seconds the estimated time left to finish the download/upload, based on the average download/upload speed.

FtpStatus

Logical, indicates the status of the download/upload, TRUE if everything is OK.

Example:

See Also:


FtpTransferPaused

Property

Indicates if a FtpReadFile/FtpWriteFile method was paused.

Value Type: Logical.

Default Value: FALSE

Read/Write: Read only.

Remarks:

The value of this property can be checked if FtpReadFile/FtpWriteFile returns FALSE, to know if the user paused the download/upload.

Example:

See Also:


FtpTransferStart

Event

Occurs When an FtpReadFile/FtpWriteFile method starts. Use it to prepare your download/upload status updates.


FtpUserName

Property

Specifies the name of the user to log on. If this parameter is  empty, the class uses an appropriate default. For the FTP protocol, the default is "anonymous".

Value Type: Character.

Default Value: ""

Read/Write: Yes.

Remarks:

If you specify a user name in the URL passed to FtpOpen, that user name will be used instead. The value of this property will NOT be updated with the user name included in the URL passed to FtpOpen, instead, the value of UrlUserName will be updated.

Example:

See Also:


FtpWriteFile(cLocalFile, cRemoteFile, [lResume])

Method

Retrieves a file from the FTP server and stores it under the specified file name, creating a new local file in the process.

Parameters

cLocalFile

Character expression that specifies the name of the local file to upload.

cRemoteFile

Character expression that specifies the name of the remote file.

lResume

Specifies if the upload should be resumed. If set to TRUE, and the local file size is larger than the remote file size, the upload is resumed.

Return Value:

Boolean.  Returns TRUE if successful, or FALSE otherwise.

Remarks:

This method does not block the VFP program, and allows the display of progress information to the user. See the FtpTransferStart, FtpTransfer and FtpTransferEnd events.

This method encapsulates the FtpOpenFile, InternetWriteFile API functions.

Flags that modify the behaviour of this method:

FtpFlagHyperLink

FtpFlagNeedFile

FtpFlagReload

FtpFlagResynchronize

FtpFlagTransferBinary

See Also:


hConnect

Property

Internet handle used by FtpOpen and FtpClose

Value Type: Numeric.

Default Value: 0

Read/Write: Read.

Remarks:

Example:

See Also:


hFile

Property

Internet handle used by FtpOpenFile, InternetReadFile, InternetWriteFile...

Value Type: Numeric.

Default Value: 0

Read/Write: Read.

Remarks:

Example:

See Also:


hFind

Property

Internet handle used by FtpFindFirstFile, InternetFindNextFile...

Value Type: Numeric.

Default Value: 0

Read/Write: Read.

Remarks:

Example:

See Also:


hFtpCommand

Property

Internet handle returned by FtpCommand.

Value Type: Numeric.

Default Value: 0

Read/Write: Read.

Remarks:

Example:

See Also:


hInternet

Property

Internet handle used by InternetOpen, InternetClose.

Value Type: Numeric.

Default Value: 0

Read/Write: Read.

Remarks:

Example:

See Also:


InternetAccessType

Property

Specifies the type of access required.

Value Type: Numeric.

Default Value: 0 (INTERNET_OPEN_TYPE_PRECONFIG).

Read/Write: Yes.

Remarks:

This parameter is related to the use of proxies or direct connection to the internet.

This parameter can be one of the following values:

0 INTERNET_OPEN_TYPE_PRECONFIG

Retrieves the proxy or direct configuration from the registry.

1 INTERNET_OPEN_TYPE_DIRECT

No proxy is used.

3 INTERNET_OPEN_TYPE_PROXY

Passes requests to the proxy/proxies specified in ctlProxyName, unless a proxy bypass list is supplied in ctlProxyBypass and the name to be resolved bypasses the proxy. In this case, the function uses INTERNET_OPEN_TYPE_DIRECT.

See ctlProxy and ctlProxyBypass properties.

4 INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY

Retrieves the proxy or direct configuration from the registry and prevents the use of a startup Microsoft JScript or Internet Setup (INS) file.

There is no value 2 for this parameter, since that value does not exist for the dwAccessType parameter in WinINet.

Example:

See Also:


InternetClose()

Method

Ends an application's use of the WinINet functions

Return Value:

None.

Remarks:

See Also:


InternetFlagAsync

Property

Makes only asynchronous requests on handles descended from the handle returned from this function. Only the InternetOpen function uses this flag.

Value Type: Logical.

Default Value: .F.

Read/Write: Yes.

Remarks:

Never set this flag to TRUE! VFP does not provide a way to use callback functions.

Example:

See Also:


InternetFlagFromCache

Property

Does not make network requests. All entities are returned from the cache. If the requested item is not in the cache, a suitable error, such as ERROR_FILE_NOT_FOUND, is returned.

Value Type: Logical.

Default Value: .F.

Read/Write: Yes.

Remarks:

Example:

See Also:


InternetFlagOffline

Property

Identical to INTERNET_FLAG_FROM_CACHE. Does not make network requests. All entities are returned from the cache. If the requested item is not in the cache, a suitable error, such as ERROR_FILE_NOT_FOUND, is returned

Value Type: Logical.

Default Value: .F.

Read/Write: Yes.

Remarks:

Example:

See Also:


InternetOpen()

Method

Initializes an application's use of the WinINet functions.

Return Value:

None.

Remarks:

See Also:


InternetProxyBypass

Property

Specifies an optional list of host names or IP addresses, or both, that should not be routed through the proxy when ctlProxyMode is set to INTERNET_OPEN_TYPE_PROXY. The list can contain wildcards. Do not use an empty string, because it will be used as the proxy bypass list. If this property specifies the "<local>" string as the only entry, the function bypasses any host name that does not contain a period. If ctlProxyMode is not set to INTERNET_OPEN_TYPE_PROXY, this property is ignored.

Value Type: Character.

Default Value: "<local>"

Read/Write: Yes.

Remarks:

Host names or IP addresses that are known locally can be listed in the proxy bypass. This list can contain wildcards, "*", which cause the application to bypass the proxy server for addresses that fit the specified pattern. To list multiple addresses and host names, separate them with blank spaces in the proxy bypass string. If the ""<local>"" macro is specified, the function bypasses any host name that does not contain a period.

Example:

bypass the proxy for any host name that does not contain a period

ctlProxyBypass ="<local>"

bypass the proxy for any host name that starts with the letters "ms"

ctlProxyBypass = "ms*"

bypass the proxy for any host name that contains "int", such as "internet" and "painter"

ctlProxyBypass = "*int*"

bypass the proxy for the host name "example" and any host name that contains "test"

ctlProxyBypass = "example *test*"

See Also:


InternetProxyName

Property

Specifies the name of the proxy server(s) to use when proxy access is specified by setting ctlProxyMode to INTERNET_OPEN_TYPE_PROXY. If the value is an empty string, ctlProxyMode INTERNET_OPEN_TYPE_DIRECT will be used.

Value Type: Character.

Default Value: None

Read/Write: Yes.

Remarks:

WinINet recognizes two types of proxies: CERN type proxies (HTTP only) and TIS FTP proxies (FTP only).

If Internet Explorer is installed, WinINet also support SOCKS type proxies. InternetConnect assumes, by default, that the specified proxy is a CERN proxy. If the access type is set to INTERNET_OPEN_TYPE_DIRECT or INTERNET_OPEN_TYPE_PRECONFIG, the lpszProxyName parameter of InternetOpen should be set to NULL. Otherwise, the value passed to lpszProxyName must contain the proxies in a space-delimited string. The proxy listings can contain the port number that is used to access the proxy.

To list a proxy for a specific protocol, the string must follow the format ""<protocol>=<protocol>://<proxy_name>"".

The valid protocols are HTTP, HTTPS, FTP, and Gopher.

For example, to list an FTP proxy, a valid string would be ""ftp=ftp://ftp_proxy_name:21"", where ftp_proxy_name is the name of the FTP proxy and 21 is the port number that must be used to access the proxy.

If the proxy uses the default port number for that protocol, the port number can be omitted.

If a proxy name is listed by itself, it is used as the default proxy for any protocols that do not have a specific proxy specified.

For example, ""http=http://http_proxy other"" would use http_proxy for any HTTP operations, while all other protocols would use other.

By default, the function assumes that the proxy specified by lpszProxyName is a CERN proxy.

An application can specify more than one proxy, including different proxies for the different protocols.

For example, if you specify ""ftp=ftp://ftp-gw gopher=http://jericho:99 proxy"", FTP requests are made through the ftp-gw proxy, which listens at port 21, and Gopher requests are made through a CERN proxy called jericho, which listens at port 99. All other requests (for example, HTTP requests) are made through the CERN proxy called proxy, which listens at port 80.

Note that if the application is only using FTP, for example, it would not need to specify ""ftp=ftp://ftp-gw:21"". It could specify just ""ftp-gw"". An application is only required to specify the protocol names if it is using more than one protocol per handle returned by InternetOpen.

Example:

See Also:


InternetUserAgent

Property

Specifies the name of the application or entity calling the WinINet functions.

Value Type: Character.

Default Value: "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"

Read/Write: Yes.

Remarks:

This name is used as the User-Agent in the HTTP protocol.

See Also:


UrlExtraInfo

Property

Contains the extra information (for example, ?something or #something).

Value Type: Character.

Default Value: None

Read/Write: This property is READ ONLY

Remarks:

Example:

See Also:


UrlHostName

Property

Contains the host name.

Value Type: Character.

Default Value: None

Read/Write: This property is READ ONLY, specify the host in the url passed to ctlOpen

Remarks:

Example

See Also:


UrlPassword

Property

Contains the password.

Value Type: Character.

Default Value: None

Read/Write: This property is READ ONLY, specify the password in the url passed to ctlOpen or in FtpPassword.

Remarks:

Example:

See Also:


UrlPath

Property

Contains the URL path.

Value Type: Character.

Default Value: None

Read/Write: This property is READ ONLY, specify the path in the url passed to ctlOpen

Remarks:

Example:

See Also:


UrlPort

Property

Returns the TCP/IP port of the remote host.

Value Type: Numeric.

Default Value: 0

Read/Write: This property is READ ONLY, include the port in the URL passed to ctlOpen if you wish to use a non-default port.

Remarks:

Default ports are: HTPP: 80, FTP: 21, HTTPS: 443

Example:

See Also:


UrlSchemeCode

Property

Indicates the Internet protocol scheme.

Value Type: Numeric.

Default Value: 0

Read/Write: This property is READ ONLY

Remarks:

Example:

See Also:


UrlSchemeName

Property

Contains the scheme name.

Value Type: Character.

Default Value: 0

Read/Write: This property is READ ONLY. Returns the protocol used in the url passed to ctlOpen.

Remarks:

The protocol has to be specified by including it in the url passed to ctlOpen, like "ftp://10.10.10.10".

Possible values:

"ftp"

"http"

"https"

Example:

See Also:


UrlText

Property

Returns the complete URL of the active connection.

Value Type: Character.

Default Value: None

Read/Write: This property is READ ONLY

Remarks:

For example, if you pass "ftp://username:password@ftp.example.com" to ctlOpen, this property will return ftp://ftp.example.com:21

Example:

See Also:


UrlUserName

Property

Returns the user name used to connect to a host.

Value Type: Character.

Default Value: ""

Read/Write: This property is READ ONLY

Remarks:

Example:

See Also:


ctlAbout

Property

Returns information about the class.

Value Type: Character.

Default Value: Class name and author(s).

Read/Write: Read only.

See Also:


ctlVcxCommon

Property.

Value Type: Character.

Default Value: ctl32_common.vcx

R/W: Read/Write.

Specifies the file name of the ctl32_common.vcx file.

Remarks:

The path of the ctl32_balloontip.vcx file is added to this property value, and used to locate the class file.

See Also:


ctlVcxStructs

Property.

Value Type: Character.

Default Value: ctl32_structs.vcx

R/W: Read/Write.

Specifies the file name of the ctl32_structs.vcx file

Remarks:

The path of the ctl32_balloontip.vcx file is added to this property value, and used to locate the class file.

See Also:


ctlVersion

Property.

Value Type: Numeric.

Default Value: Version number.

R/W: Read.

Returns the version number of the class in the format YYYYMMDD, for example 20060925.

See Also:


Notes

All properties and methods with a name that start with "_" are only for internal use by the class itself.