ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Web-specific functions / Miscellaneous WEBDEV functions
  • Choosing the target of the file
  • Retrieving the parameters passed to an Active WEBDEV Page
  • Downloading large files
  • Pre-launched sessions
  • Web services
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Displays a file in the user's browser. Allows documents not accessible to the Web server to be displayed on the user's browser: files hidden for security reasons, binary memos, etc.
WEBDEV - Server code You can also give the ability to the Web user to download the file. For more details, see Downloading files. 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 Active WEBDEV Page by specifying the value of the parameters expected by the page. These parameters can be retrieved:
    • in the "Global declarations" event of the page.
    • with the PageParameter function.
WEBDEV - Server codeWindowsLinux
// Affiche une boîte de dialogue proposant à l'internaute de télécharger le fichier NOTES.TXT sur son poste. 
FileDisplay(CompleteDir(fWebDir()) + "NOTES.TXT", "application/unknown", "Notes.TXT")
WEBDEV - Server codeWindowsPHP
// Affiche une boîte de dialogue proposant à l'internaute
// de télécharger le fichier NOTES.TXT sur son poste. 
// Fichier NOTES.TXT dans le même répertoire que .PHP
FileDisplay("NOTES.TXT", "application/unknown", "Notes.TXT")
WEBDEV - Server codeWindowsLinux
// Affiche un fichier présent dans un répertoire protégé
// Ce fichier est affiché uniquement si l'utilisateur est autorisé
// Autorise est un booléen permettant de gérer les droits de l'utilisateur
IF Autorise = True THEN
	FileDisplay("c:\date\protege\plan.gif", "image/gif")
ELSE
	PageDisplay(PAGE_Erreur)
END
WEBDEV - Server codeWindows
// -- Code de clic d'un bouton de type submit
// Affiche le fichier "MonFichier.PDF" présent dans le répertoire "<NomDuProjet>_WEB"
sFichier is string
sFichier = fWebDir() + "/MonFichier.pdf"
FileDisplay(sFichier, "application/pdf")
WEBDEV - Browser codeWindows
// Page AWP : Vérifie qu'un numéro de livraison a bien été saisi 
// (le champ n'est pas vide et la taille du numéro est égale à 18)
IF NoSpace(SAI_NUMLIVRAISON) = "" OR ...
	Length(NoSpace(SAI_NUMLIVRAISON)) = 18 THEN
	// Reprend la saisie du numéro
	FileDisplay("webdev_liv_number.awp?P1=1&P2=" + CODELANGUE)
END
FileDisplay("webdev_liv_history.awp?P1=" + SAI_NUMLIVRAISON + "&P2=" + CODELANGUE)
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 the MIME type to be used. The MIME type is used to specify the type of file to be processed by the browser. Hundreds of types are defined in the MIME communication standard (available on the Internet). The most common values recognized by the majority of browsers are:
    • "text/html": HTML page (*.htm, *.html) (default)
    • "text/plain": text file (*.txt)
    • "application/pdf": PDF file (*.pdf)
    • "image/gif": GIF image (*.gif)
    • "image/jpeg": JPEG image (*.jpg, *.jpeg)
    • "video/mpeg": MPEG video (*.mpg, *.mpeg)
    • "application/unknown": displays a dialog box offering to download the file to the user's computer.
    • "application/msword": Opens a Microsoft Word file.
    • "application/vnd.ms-excel": Opens a Microsoft Excel file.
  • MIME type corresponding to one of the following constants:
    mimeTypeXMLApplicationXML content.
    mimeTypeBinaryBinary content (byte stream).
    mimeTypeDOCWord file (*.doc)
    mimeTypeDOCXWord file (*.docx)
    mimeTypeGIFGIF image (*.gif)
    mimeTypeHTMLHTML page (*.htm, *.html)
    mimeTypeJPEGJPEG image (*.jpg, *.jpeg)
    mimeTypeJSONJSON content.
    mimeTypePDFPDF document (*.pdf)
    mimeTypePNGImage content in PNG format (*.png)
    mimeTypeSOAPSOAP content in XML format.
    mimeTypeTextText (*.txt)
    mimeTypeXMLTextXML text
    mimeTypeXLSExcel file (*.xls)
    mimeTypeXLSXExcel file (*.xlsx)
    mimeTypeZIPZIP file (*.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
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 Active WEBDEV Page with parameters, name of the AWP file followed by the parameters to pass to the Active WEBDEV Page. To be directly retrieved in the "Global declarations" event 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:
CurrentBrowserthe target is the current browser.
This parameter can also correspond to the "_top" 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).
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).
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).
<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:
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)
ONLinkThe link bar will be displayed
ONLocationThe address bar will be displayed
ONMenuBarThe menu bar will be displayed
ONResizableThe new browser window will be resizable
ONSatusBarThe status bar will be displayed
ONScrollbarThe scrollbars will be displayed
ONSimpleThe window of the new browser will be a simple window (no combination of constants).
ONToolbarThe toolbar will be displayed
<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 upper-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 upper-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 Active WEBDEV Page

Several methods can be used to retrieve the parameters passed to an Active WEBDEV Page:
  1. Retrieving parameters in the "Global declarations" event of the page.
  2. Retrieving the parameters with PageParameter.

Downloading large files

Downloading files with FileDisplay can take longer than downloading files directly via an http link.
In the case of the FileDisplayfunction, the WEBDEV:
  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 be downloaded can be configured with the URL property.

Pre-launched sessions

If your project uses pre-launched sessions, this function must not be used in the project initialization event. This function must be used in the "Initialization in pre-launched session mode" event.

Web services

This function can be used in web services.
Business / UI classification: UI Code
Component: wd300dllexe.dll
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment

Last update: 05/14/2025

Send a report | Local help