Difference: 0LASubrClientDownloadFile (6 vs. 7)

Revision 72016-09-29 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.CLIENT DOWNLOAD FILE

This subroutine will download a file to the user's PC.

Changed:
<
<

>
>

 

Usage:

      PASS         <status_code>              FIELD            SHARE? Y
      PASS         <dest_file>                FIELD            SHARE? Y

Line: 70 to 70
 WINDOWS UNIX UNIX No conversion needed.

Added:
>
>

HTML Client Considerations

 
Added:
>
>
Downloading files to the HTML client normally requires a Local Connector (See AppxHTMLClient for a discussion of the Local Connector). Starting in Release 5.4.5, you can download files without the Local Connector. See .CLIENT CHECK FOR GUI to how to determine which client the user is running.

You have 2 options to send to the client without using the Local Connector:

  • Prefix the destination file name with $(pushAndOpen), e.g. $(pushAndOpen)/openthis.pdf). This tells the HTML client that you want the browser download the file and to try to open it. If the browser doesn't support opening that file type then it will ask the user to save file, which is normal browser behavior. The file will open an a new tab in the browser for one time viewing, i.e., the tab cannot be refreshed or the link shared.
  • Prefix the destination file name with $(pushAndSave), e.g. $(pushAndSave)/savethis.pdf. This tells the HTML client that you want the browser to handle downloading and saving the file. The behaviour is browser specific, i.e., some browsers will automatically save the file to the default download location, and others may display a 'Save File' dialog box.
When using these options, the APPX Server Connector stores the file in the mongo database, then passes the URL to the HTML client. The HTML client accesses the file from the mongo database. Once the file has been accessed, it is removed from the mongo database to manage storage. This means the link cannot be reused or the tab refreshed.

NOTES:

  • $(pushAndOpen) and $(pushAndSave) are case senstive, you must use them exactly as shown.
  • Although you can pass the destination name shared, you will not get a meaningful name back when using $(pushAndOpen) or $(pushAndSave).
  • These options do not work with the APPX Desktop Client
 

Comments:

Read what other users have said about this page or add your own comments.

Changed:
<
<

<--/commentPlugin-->
>
>

<--/commentPlugin-->
  -- JeanNeron - 2012-01-31 \ No newline at end of file
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback