PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
New WINDEV, WEBDEV, WINDEV Mobile 25 feature!
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
fContentType (Function)
In french: fContentType
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.
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)
// fContentType returns "image/png" for "image.png",
// "vide/mpeg" for "video,mpeg" and "application/pdf" for "file.pdf"
myAttach..ContentType = fContentType(sFile)
 
// Add the attachment
Add(myEmail..Attach, myAttach)
END
 
// Display a file in the user's browser in server code
FileDisplay(sFile, fContentType (sFile))
Syntax
<Result> = fContentType(<File path>)
<Result>: Character string
  • File type according to MIME standard:
    Versions 22 and later
    typeMimeXMLApplication
    New in version 22
    typeMimeXMLApplication
    typeMimeXMLApplication
    XML content.
    Versions 22 and later
    typeMimeBinary
    New in version 22
    typeMimeBinary
    typeMimeBinary
    Binary content (byte stream).
    Versions 22 and later
    typeMimeDOC
    New in version 22
    typeMimeDOC
    typeMimeDOC
    Content such as Word file (*.doc)
    Versions 22 and later
    typeMimeDOCX
    New in version 22
    typeMimeDOCX
    typeMimeDOCX
    Content such as Word file (*.docx)
    Versions 22 and later
    typeMimeGIF
    New in version 22
    typeMimeGIF
    typeMimeGIF
    Content such as Image in GIF format (*.gif)
    Versions 22 and later
    typeMimeHTML
    New in version 22
    typeMimeHTML
    typeMimeHTML
    Content such as HTML page (*.htm, *.html)
    Versions 22 and later
    typeMimeJPEG
    New in version 22
    typeMimeJPEG
    typeMimeJPEG
    Content such as image in JPEG format (*.jpg, *.jpeg)
    Versions 22 and later
    typeMimeJSON
    New in version 22
    typeMimeJSON
    typeMimeJSON
    JSON content.
    Versions 22 and later
    typeMimePDF
    New in version 22
    typeMimePDF
    typeMimePDF
    Content such as PDF document (*.pdf)
    Versions 22 and later
    typeMimePNG
    New in version 22
    typeMimePNG
    typeMimePNG
    Content such as image in JPEG format (*.png)
    Versions 22 and later
    typeMimeSOAP
    New in version 22
    typeMimeSOAP
    typeMimeSOAP
    SOAP content in XML format.
    Versions 22 and later
    typeMimeText
    New in version 22
    typeMimeText
    typeMimeText
    Content in text format (*.txt)
    Versions 22 and later
    typeMimeXMLText
    New in version 22
    typeMimeXMLText
    typeMimeXMLText
    Text content in XML format
    Versions 22 and later
    typeMimeXLS
    New in version 22
    typeMimeXLS
    typeMimeXLS
    Content in Excel format (*.xls)
    Versions 22 and later
    typeMimeXLSX
    New in version 22
    typeMimeXLSX
    typeMimeXLSX
    Content in Excel format (*.xlsx)
    Versions 22 and later
    typeMimeZIP
    New in version 22
    typeMimeZIP
    typeMimeZIP
    Content 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 : wd250std.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment