AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones específicas de la Web / Funciones varias de WEBDEV
  • Choosing the target of the file
  • Retrieving the parameters passed to an Active WEBDEV Page
  • Downloading large files
  • Pre-launched sessions
  • Web services
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
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 - Código Servidor 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 - Código Navegador 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 - Código ServidorWindowsLinux
// Displays a dialog box prompting the user to download the NOTES.TXT file to their computer. 
FileDisplay(CompleteDir(fWebDir()) + "NOTES.TXT", "application/unknown", "Notes.TXT")
WEBDEV - Código ServidorWindowsPHP
// 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 - Código ServidorWindowsLinux
// 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 - Código ServidorWindows
// -- 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 - Código NavegadorWindows
// AWP page: Checks that a delivery number has been 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_number.awp?P1=" + EDT_DELIVERYNUM + "&P2=" + LANGUAGECODE)
Sintaxis
WEBDEV - Código ServidorPHP

Use in WEBDEV Server Ocultar los detalles

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 MIME communication standard (available on the Internet). The most common values recognized by most 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": displays a Word file.
    • "application/vnd.ms-excel": displays an Excel file.
  • MIME type corresponding to one of the following constants:
    mimeTypeXMLApplicationContenido XML.
    mimeTypeBinaryContenido binario (flujo de bytes).
    mimeTypeDOCArchivo Word (*.doc)
    mimeTypeDOCXArchivo Word (*.docx)
    mimeTypeGIFImagen GIF (*.gif)
    mimeTypeHTMLPágina HTML (*.htm, *.html)
    mimeTypeJPEGImagen JPEG (*.jpg, *.jpeg)
    mimeTypeJSONContenido JSON.
    mimeTypePDFDocumento PDF (*.pdf)
    mimeTypePNGImagen JPEG (*.png)
    mimeTypeSOAPContenido SOAP en formato XML.
    mimeTypeTextTexto (*.txt)
    mimeTypeXMLTextTexto XML
    mimeTypeXLSArchivo Excel (*.xls)
    mimeTypeXLSXArchivo Excel (*.xlsx)
    mimeTypeZIPArchivo ZIP (*.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 - Código Navegador

Use in WEBDEV Browser Ocultar los detalles

FileDisplay(<Page address> [, <Target>] , <Name of the window> [, <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).
<Name of the window>: 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".
Observaciones
WEBDEV - Código NavegadorWindows

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 - Código NavegadorWindows

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.
Clasificación Lógica de negocio / UI: Código UI
Componente: wd300dllexe.dll
Versión mínima requerida
  • Versión 9
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 23/11/2024

Señalar un error o enviar una sugerencia | Ayuda local