GetDownloadFileURL

Description

Returns the URL for a file on the Web server.

Syntax

string GetDownloadFileURL (string serverFile , boolean open)

Argument

Description

serverFile

A string containing the name of the file on the application’s virtual file path on the Web server.

open

A boolean that determines whether to access the file in open mode or download mode. Values are:

  • true Display the file directly in a browser window (open mode).

  • false Display a dialog box that lets the user open the file, save the file, or cancel the download operation (download mode).

Returns

String. Returns the URL of the file in ASCII format.

Usage

The open argument applies only if a Web Forms application user copies the returned URL in the current browser Address box or if you set a hyperlink in the current browser to the returned URL address.

Examples

Example 1

The following code places the URL for a text file in a MultiLineEdit box and includes it as a hyperlink in a StaticHyperLink control:

#if defined PBWEBFORM then
	string s
	s = GetDownloadFileUrl("c:\aaa.txt", false)
	mle_1.text += "~r~n" + s
	shl_1.url = s  //shl_1: static hyperlink
#end if

See also