docs.roxen.comBack to normal mode
DocsRoxenWebServer 6.1Web Developer ManualProgramming Tags
Copyright © 2021, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com

<guess-content-type/>

Provided by module: Tags: RXML tags

Tries to find a content type from content, filename or file path. Either "content" or "filename" attributes must be supplied.


Attributes

content="string"

Guess the content type from the content. This function is currently only capable of recognizing several common image formats. If the content format isn't recognized then the fallback content type in the Content Types module is returned. That type is "application/octet-stream" by default.

<guess-content-type content='&form.image;'/>

filename="{filename, path}"

The tag makes its guess from the filename suffix, but you may provide a full path for convenience. If you want it to verify that the file is an image by its file content use the "content" attribute instead.

<guess-content-type filename='/foo/bar.jpg'/>
image/jpeg