ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV, WEBDEV and WINDEV Mobile 28 feature!
Help / WLanguage / WLanguage functions / Standard functions / External file management functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
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.
Example
// 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)
END
 
// Display a file in the user's browser in server code
FileDisplay(sFile, fMIMEType (sFile))
Syntax
<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.
Remarks
The MIME type is determined from the file extension.
Component: wd280std.dll
Minimum version required
  • Version 28
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/01/2022

Send a report | Local help