ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WEBDEV 2025 feature!
This content has been translated automatically.  Click here  to view the French version.
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
FileDownload (Function)
In french: FileDownload
AjaxNot available
Starts file download by browser. This file will be saved in the download directory defined in the browser settings.
Example
OR sFile = fTempFile()
// Filling the file
// ...
// Change the name of the temporary backup file
FileDownload(sFile, "Report" + DateSys() + ".pdf", mimeTypePDF)
// Deletes temporary file at end of download
fDelete(sFile)
Syntax
FileDownload(<File to download> [, <New File Name> [, <MIME type>]])
<File to download>: Character string
Name of the file (on the server) to be sent to the client.
<New File Name>: Optional character string
Name under which the file will be offered for saving on the client workstation. If this parameter is missing or is an empty string (""), the file name on the server will be used.
<MIME type>: Optional Ansi character string
In most cases, this parameter doesn't need to be filled in: the MIME type is generally ignored by browsers.
  • 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)
    • "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 (default).
    • "application/msword": displays a Word file.
    • "application/vnd.ms-excel": displays an 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: 11/16/2024

Send a report | Local help