ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WEBDEV 2025 feature!
Help / WLanguage / WLanguage functions / Web-specific functions / Miscellaneous WEBDEV functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
FileView (Function)
In french: FichierVisualise
AjaxNot available
Opens a file in the browser. The file is downloaded to a temporary directory defined by the browser, then displayed in the specific viewer for that file type.
If the file cannot be viewed (e.g., type not supported), it is downloaded directly to the browser's default download directory.
Example
let sFile = fTempFile()
// Load file
// ...
// Set a temporary file name
FileView(sFile, "Report" + DateSys() + ".pdf", mimeTypePDF)
// Deletes temporary file once the download is completed
fDelete(sFile)
Syntax
FileView(<File to download> [, <New file name> [, <MIME type>]])
<File to download>: Character string
Name of the file (located on the server) to be sent to and displayed on the user's computer.
<New file name>: Optional character string
Name suggested when the user saves the file. If this parameter is not specified or is an empty string (""), the file name on the server will be used.
This name will also be suggested by default if the user saves the file on their computer.
<MIME type>: Optional character string
File MIME type. This value will be used by the user's computer to determine how to display the file. If this value is not specified, the value returned by fMIMEType (with the file name) will be used.
The possible values are:
  • 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 the majority of browsers are:
    • "text/html": HTML page (*.htm, *.html)
    • "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/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)
    mimeTypePNGJPEG image (*.png)
    mimeTypeSOAPSOAP content in XML format.
    mimeTypeTextText (*.txt)
    mimeTypeXMLTextXML text
    mimeTypeXLSExcel file (*.xls)
    mimeTypeXLSXExcel file (*.xlsx)
    mimeTypeZIPZIP file (*.zip)
Business / UI classification: UI Code
Component: wd300page.dll
Minimum version required
  • Version 2025
Comments
Click [Add] to post a comment

Last update: 02/12/2025

Send a report | Local help