New WINDEV, WEBDEV and WINDEV Mobile 28 feature!
Help / WLanguage / WLanguage functions / Standard functions / External file management functions
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Returns the type of file according to the MIME standard (Multipurpose Internet Mail Extensions). The "Content Type" tells the software how it should interpret the file.
Remark: This function is equivalent to fContentType.
// Add attachments to an email
arrAttachment is array of strings = ["image.png", "video.mpeg", "file.pdf"]
myEmail is Email
FOR EACH sFile OF arrAttachment
// Build the emailAttach variable
myAttach is emailAttach
myAttach.Name = sFile
myAttach.Content = fLoadBuffer(sFile)
// fMIMEType returns "image/png" for "image.png",
// "vide/mpeg" for "video,mpeg" and "application/pdf" for "file.pdf"
myAttach.ContentType = fMIMEType(sFile)
// Add the attachment
Add(myEmail.Attach, myAttach)
// Display a file in the user's browser in server code
FileDisplay(sFile, fMIMEType (sFile))
<Result> = fMIMEType(<File path>)
<Result>: Character string
  • File type according to MIME standard:
    typeMimeXMLApplicationXML content.
    typeMimeBinaryBinary content (byte stream).
    typeMimeDOCContent such as Word file (*.doc)
    typeMimeDOCXContent such as Word file (*.docx)
    typeMimeGIFContent such as Image in GIF format (*.gif)
    typeMimeHTMLContent such as HTML page (*.htm, *.html)
    typeMimeJPEGContent such as image in JPEG format (*.jpg, *.jpeg)
    typeMimeJSONJSON content.
    typeMimePDFContent such as PDF document (*.pdf)
    typeMimePNGContent such as image in JPEG format (*.png)
    typeMimeSOAPSOAP content in XML format.
    typeMimeTextContent in text format (*.txt)
    typeMimeXMLTextText content in XML format
    typeMimeXLSContent in Excel format (*.xls)
    typeMimeXLSXContent in Excel format (*.xlsx)
    typeMimeZIPContent in ZIP format (*.zip)
  • Empty string ("") if the MIME type could not be determined.
<File path>: Character string
  • Name and full (or relative) path of the file (up to 260 characters).
  • Full (or relative) path of directory (up to 260 characters). If this parameter corresponds to a directory name, this name may (or may not) end with "\".
A UNC path can be used.
The MIME type is determined from the file extension.
Component: wd280std.dll
Minimum version required
  • Version 28
This page is also available for…
Click [Add] to post a comment

Last update: 09/01/2022

Send a report | Local help