PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Choosing the target of the file
  • Retrieving the parameters passed to an AWP page
  • Downloading large files
  • Cached sessions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
FileDisplay (Function)
In French: FichierAffiche
AjaxNot available
Displays a file in the browser of Web user. Allows you to display in the browser of Web user documents that are not accessible to the Web server: files hidden for security reasons, binary memos, ...
WEBDEV - Server code You can also give the ability to the Web user to download the file. See Downloading files for more details. Once FileDisplay has been run, the site execution site continues but the request is ignored (PageRefresh would be ignored for example).
WEBDEV - Browser code The files displayed can be:
  • any page, accessible on Internet or on a local network.
  • an AWP page by specifying the value of the parameters expected by the page. These parameters can be retrieved:
    • in the declaration code of global variables of page
    • with PageParameter.
WEBDEV - Server codeWindowsLinux
// Displays a dialog box allowing the Web user
// to download the NOTES.TXT file on his computer.
FileDisplay(CompleteDir(fWebDir()) + "NOTES.TXT", ...
"application/unknown", "Notes.TXT")
WEBDEV - Server codeWindowsPHP
// Displays a dialog box allowing the Web user
// to download the NOTES.TXT file on his computer.
// NOTES.TXT and .PHP are found in the same directory
FileDisplay("NOTES.TXT", "application/unknown", "Notes.TXT")
WEBDEV - Server codeWindowsLinux
// Displays a file found in a protected directory
// This file is displayed only if the user is allowed to
// Authorize is a boolean used to manage the user rights
IF Authorize = True THEN
FileDisplay("c:\date\protected\map.gif", "image/gif")
ELSE
PageDisplay(PAGE_Error)
END
WEBDEV - Server codeWindows
// -- Click code of Submit button
// Display the "MyFile.PDF" file
// found in the "<ProjectName>_WEB" directory
sFile is string
sFile = fWebDir() + "/MyFile.pdf"
FileDisplay(sFile, "application/pdf")
WEBDEV - Browser codeWindows
// AWP page: Checks whether a delivery number was entered
// (the control is not empty and the number size is equal to 18)
IF NoSpace(EDT_DELIVERYNUM) = "" OR ...
Length(NoSpace(EDT_DELIVERYNUM)) < 18 THEN
// Resumes the input of the number
FileDisplay("webdev_del_number.awp?P1=1&P2=" + LANGUAGECODE)
END
FileDisplay("webdev_del_history.awp?P1=" + EDT_DELIVERYNUM +  ...
"&P2=" + LANGUAGECODE)
Syntax
WEBDEV - Server codePHP

Use in WEBDEV Server Hide the details

FileDisplay(<File Name> [, <MIME Type> [, <Name of File for Backup>]])
<File Name>: Character string
Full path of file to display in the browser of Web user. The file must be accessible on the server (rights, existence of the file, ...).
<MIME Type>: Optional Ansi character string
  • Name of MIME type to use. The MIME type is used to indicate to the browser the type of file that must be handled. Hundreds of types are defined in the MIMI communication standard (available on Internet). The most common values recognized by most browsers are:
    • "text/html": HTML page (*.htm, *.html) (by default)
    • "text/plain": text file (*.txt)
    • "application/pdf": document in PDF format (*.pdf)
    • "image/gif": image in GIF format (*.gif)
    • "image/jpeg": image in JPEG format (*.jpg, *.jpeg)
    • "video/mpeg": video in MPEG format (*.mpg, *.mpeg)
    • "application/unknown": used to display a dialog box proposing to download the file onto the computer of Web user.
    • "application/msword": used to display a Word file.
    • "application/vnd.ms-excel": used to display an Excel file.
  • Versions 22 and later
    MIME type corresponding to one of the following constants:
    Versions 22 and later
    typeMimeXMLApplication
    New in version 22
    typeMimeXMLApplication
    typeMimeXMLApplication
    XML content.
    Versions 22 and later
    typeMimeBinary
    New in version 22
    typeMimeBinary
    typeMimeBinary
    Binary content (byte stream).
    Versions 22 and later
    typeMimeDOC
    New in version 22
    typeMimeDOC
    typeMimeDOC
    Content such as Word file (*.doc)
    Versions 22 and later
    typeMimeDOCX
    New in version 22
    typeMimeDOCX
    typeMimeDOCX
    Content such as Word file (*.docx)
    Versions 22 and later
    typeMimeGIF
    New in version 22
    typeMimeGIF
    typeMimeGIF
    Content such as Image in GIF format (*.gif)
    Versions 22 and later
    typeMimeHTML
    New in version 22
    typeMimeHTML
    typeMimeHTML
    Content such as HTML page (*.htm, *.html)
    Versions 22 and later
    typeMimeJPEG
    New in version 22
    typeMimeJPEG
    typeMimeJPEG
    Content such as image in JPEG format (*.jpg, *.jpeg)
    Versions 22 and later
    typeMimeJSON
    New in version 22
    typeMimeJSON
    typeMimeJSON
    JSON content.
    Versions 22 and later
    typeMimePDF
    New in version 22
    typeMimePDF
    typeMimePDF
    Content such as PDF document (*.pdf)
    Versions 22 and later
    typeMimePNG
    New in version 22
    typeMimePNG
    typeMimePNG
    Content such as image in JPEG format (*.png)
    Versions 22 and later
    typeMimeSOAP
    New in version 22
    typeMimeSOAP
    typeMimeSOAP
    SOAP content in XML format.
    Versions 22 and later
    typeMimeText
    New in version 22
    typeMimeText
    typeMimeText
    Content in text format (*.txt)
    Versions 22 and later
    typeMimeXMLText
    New in version 22
    typeMimeXMLText
    typeMimeXMLText
    Text content in XML format
    Versions 22 and later
    typeMimeXLS
    New in version 22
    typeMimeXLS
    typeMimeXLS
    Content in Excel format (*.xls)
    Versions 22 and later
    typeMimeXLSX
    New in version 22
    typeMimeXLSX
    typeMimeXLSX
    Content in Excel format (*.xlsx)
    Versions 22 and later
    typeMimeZIP
    New in version 22
    typeMimeZIP
    typeMimeZIP
    Content in ZIP format (*.zip)
    New in version 22
    MIME type corresponding to one of the following constants:
    Versions 22 and later
    typeMimeXMLApplication
    New in version 22
    typeMimeXMLApplication
    typeMimeXMLApplication
    XML content.
    Versions 22 and later
    typeMimeBinary
    New in version 22
    typeMimeBinary
    typeMimeBinary
    Binary content (byte stream).
    Versions 22 and later
    typeMimeDOC
    New in version 22
    typeMimeDOC
    typeMimeDOC
    Content such as Word file (*.doc)
    Versions 22 and later
    typeMimeDOCX
    New in version 22
    typeMimeDOCX
    typeMimeDOCX
    Content such as Word file (*.docx)
    Versions 22 and later
    typeMimeGIF
    New in version 22
    typeMimeGIF
    typeMimeGIF
    Content such as Image in GIF format (*.gif)
    Versions 22 and later
    typeMimeHTML
    New in version 22
    typeMimeHTML
    typeMimeHTML
    Content such as HTML page (*.htm, *.html)
    Versions 22 and later
    typeMimeJPEG
    New in version 22
    typeMimeJPEG
    typeMimeJPEG
    Content such as image in JPEG format (*.jpg, *.jpeg)
    Versions 22 and later
    typeMimeJSON
    New in version 22
    typeMimeJSON
    typeMimeJSON
    JSON content.
    Versions 22 and later
    typeMimePDF
    New in version 22
    typeMimePDF
    typeMimePDF
    Content such as PDF document (*.pdf)
    Versions 22 and later
    typeMimePNG
    New in version 22
    typeMimePNG
    typeMimePNG
    Content such as image in JPEG format (*.png)
    Versions 22 and later
    typeMimeSOAP
    New in version 22
    typeMimeSOAP
    typeMimeSOAP
    SOAP content in XML format.
    Versions 22 and later
    typeMimeText
    New in version 22
    typeMimeText
    typeMimeText
    Content in text format (*.txt)
    Versions 22 and later
    typeMimeXMLText
    New in version 22
    typeMimeXMLText
    typeMimeXMLText
    Text content in XML format
    Versions 22 and later
    typeMimeXLS
    New in version 22
    typeMimeXLS
    typeMimeXLS
    Content in Excel format (*.xls)
    Versions 22 and later
    typeMimeXLSX
    New in version 22
    typeMimeXLSX
    typeMimeXLSX
    Content in Excel format (*.xlsx)
    Versions 22 and later
    typeMimeZIP
    New in version 22
    typeMimeZIP
    typeMimeZIP
    Content in ZIP format (*.zip)
    MIME type corresponding to one of the following constants:
    Versions 22 and later
    typeMimeXMLApplication
    New in version 22
    typeMimeXMLApplication
    typeMimeXMLApplication
    XML content.
    Versions 22 and later
    typeMimeBinary
    New in version 22
    typeMimeBinary
    typeMimeBinary
    Binary content (byte stream).
    Versions 22 and later
    typeMimeDOC
    New in version 22
    typeMimeDOC
    typeMimeDOC
    Content such as Word file (*.doc)
    Versions 22 and later
    typeMimeDOCX
    New in version 22
    typeMimeDOCX
    typeMimeDOCX
    Content such as Word file (*.docx)
    Versions 22 and later
    typeMimeGIF
    New in version 22
    typeMimeGIF
    typeMimeGIF
    Content such as Image in GIF format (*.gif)
    Versions 22 and later
    typeMimeHTML
    New in version 22
    typeMimeHTML
    typeMimeHTML
    Content such as HTML page (*.htm, *.html)
    Versions 22 and later
    typeMimeJPEG
    New in version 22
    typeMimeJPEG
    typeMimeJPEG
    Content such as image in JPEG format (*.jpg, *.jpeg)
    Versions 22 and later
    typeMimeJSON
    New in version 22
    typeMimeJSON
    typeMimeJSON
    JSON content.
    Versions 22 and later
    typeMimePDF
    New in version 22
    typeMimePDF
    typeMimePDF
    Content such as PDF document (*.pdf)
    Versions 22 and later
    typeMimePNG
    New in version 22
    typeMimePNG
    typeMimePNG
    Content such as image in JPEG format (*.png)
    Versions 22 and later
    typeMimeSOAP
    New in version 22
    typeMimeSOAP
    typeMimeSOAP
    SOAP content in XML format.
    Versions 22 and later
    typeMimeText
    New in version 22
    typeMimeText
    typeMimeText
    Content in text format (*.txt)
    Versions 22 and later
    typeMimeXMLText
    New in version 22
    typeMimeXMLText
    typeMimeXMLText
    Text content in XML format
    Versions 22 and later
    typeMimeXLS
    New in version 22
    typeMimeXLS
    typeMimeXLS
    Content in Excel format (*.xls)
    Versions 22 and later
    typeMimeXLSX
    New in version 22
    typeMimeXLSX
    typeMimeXLSX
    Content in Excel format (*.xlsx)
    Versions 22 and later
    typeMimeZIP
    New in version 22
    typeMimeZIP
    typeMimeZIP
    Content in ZIP format (*.zip)
<Name of File for Backup>: Optional character string
Name of file to save if the Web user wants to download the file onto his computer. If this parameter is specified, the file download is automatically proposed.
WEBDEV - Browser code

Use in WEBDEV Browser Hide the details

FileDisplay(<Page Address> [, <Target>] , <Window Name> [, <Options> [, <Width> [, <Height> [, <Horizontal Position> [, <Vertical Position> [, <Javascript Parameters>]]]]]])
<Page Address>: Character string with quotes
URL address of the page that must be displayed in the new browser window. If this parameter corresponds to an empty string (""), a blank page is opened ("about:blank").
If the page to display is an AWP page with parameters, name of the AWP file followed by the parameters to pass to the AWP page. To be directly retrieved in the declaration code of global variables of the page, the parameters must be named P1, P2, .., P256.
<Target>: Optional character string or constant
Name of target frame. <Target> can also take the following values:
ParentFramethe target is the container of the current page (parent frameset, parent browser).
This parameter can also correspond to the "_parent" string (compatibility with WEBDEV 1.5).
CurrentFramethe target is the current frame (default value).
This parameter can also correspond to the "_self" string (compatibility with WEBDEV 1.5).
CurrentBrowserthe target is the current browser.
This parameter can also correspond to the "_top" string (compatibility with WEBDEV 1.5).
NewBrowserthe target is a new browser (a new browser window is opened). The following parameters of FileDisplay are used to configure this new window.
This parameter can also correspond to the "_blank" string (compatibility with WEBDEV 1.5).
<Window Name>: Optional character string
Name of the new browser window. This parameter allows you to redisplay a page in a browser window with the same name (if several browser windows are opened on the computer of the Web user).
<Options>: Optional Integer constant (or combination of constants)
Parameters of the new browser window:
ONLocationThe address bar will be displayed
ONScrollbarThe scrollbars will be displayed
ONFull
(Default value)
The window of the new browser will include an address bar and scrollbars (equivalent to the combination of all the previous constants)
ONResizableThe window of new browser will be resizable
ONLinkThe link bar will be displayed
ONMenuBarThe menu bar will be displayed
ONSatusBarThe status bar will be displayed
ONToolbarThe toolbar will be displayed
ONSimpleThe window of the new browser will be a simple window (no combination of constants).
<Width>: Optional integer
Width (in pixels) of the new browser window. Can correspond to the Default constant.
<Height>: Optional integer
Height in pixels of the new browser window. Can correspond to the Default constant.
<Horizontal Position>: Optional integer
Horizontal position (in pixels) of the new browser window in relation to the top left corner of the main screen. Can correspond to the Default constant.
<Vertical Position>: Optional integer
Vertical position in pixels of the new browser window in relation to the top left corner of the screen. Can correspond to the Default constant.
<Javascript Parameters>: Optional character string
Other Javascript parameters that must be used when opening a new browser if <Target> is set to "_blank".
Remarks
WEBDEV - Browser codeWindows

Choosing the target of the file

To choose the target of the file, we recommend that you use the <Target> parameter of FileDisplay rather than ChangeTarget. Indeed, in this case, the corresponding JavaScript code is smaller and the size of your pages is optimized.
WEBDEV - Browser codeWindows

Retrieving the parameters passed to an AWP page

Several methods can be used to retrieve the parameters passed to an AWP page:
  1. Retrieving the paramers in the declaration code of global variables of the page.
  2. Retrieving the parameters with PageParameter.

Downloading large files

Downloading files via FileDisplay can be slower than the direct download by an http link.
When using FileDisplay, the WEBDEV engine:
  1. Opens the file to download.
  2. Transfers the file to the Web server while asking to send the file to the Web user.
When using an http link, the browser of the Web user directly finds the file to download.
For the large files, we recommend that you use an http link. In this case, the path and name of the file to download can be configured by ..URL.
Versions 20 and later

Cached sessions

If your project is using cached sessions, this function must not be used in the "Initializing the project" process. This function must be used in the "Initializing the project after connection to the site" process.
New in version 20

Cached sessions

If your project is using cached sessions, this function must not be used in the "Initializing the project" process. This function must be used in the "Initializing the project after connection to the site" process.

Cached sessions

If your project is using cached sessions, this function must not be used in the "Initializing the project" process. This function must be used in the "Initializing the project after connection to the site" process.
Components
WEBDEV - Server code wd230dllexe.dll
WEBDEV - Browser code WDJS.DLL
Linux wd230dllexe.so
Minimum required version
  • Version 9
Comments
Click [Add] to post a comment