Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

DownloadFile – PB Docs 120 – PowerBuilder Library

DownloadFile – PB Docs 120


DownloadFile

Use to download a file from the Web server to a client computer.

Syntax

Parameters

  • 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 � show the file directly in a browser window (open mode).
    • false � show a dialog box that lets the user open the file, save the file, or cancel the download operation (download mode).

Returns

None.

Examples


  • This example opens the file aaa.txt in download mode:

    The download mode causes the File Download dialog box to appear, giving the user the choice of opening the file, saving the file, or cancelling the operation. The File Download dialog box shows the file name, the file type, the number of bytes in the file, and the name of the server that hosts the file.


  • This code opens a dialog box that allows users to select a directory and download multiple files from the same directory:

Usage

Some types of files cannot be viewed directly in a browser window. For these types of files, the open argument is disregarded. Instead, the File Download dialog box appears, as if you set the open argument to false, but the dialog box provides no option to open the file directly. In this case, users can only save the file to disk or cancel the download operation.

If the file you indicate in the serverFile argument is not present on the server, application users do not see an error message. You can use the FileExists PowerScript function to make sure the file exists in the server directory before you call DownloadFile.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x