Qore Mime Module Reference 1.6
All Classes Namespaces Functions Variables Modules Pages
Mime Namespace Reference

public Mime namespace defines constants and functions relevant to MIME More...

Classes

hashdecl  FormDataMessageInfo
 parsed form-data message part info More...
 
hashdecl  MessageInfo
 message and part info hash More...
 
hashdecl  MessagePartInfo
 message part hash More...
 
class  MultiPartAlternativeMessage
 implements the MultiPartAlternativeMessage class, a specialization of MultiPartMessage More...
 
class  MultiPartFormDataMessage
 implements the MultiPartFormDataMessage class, a specialization of MultiPartMessage More...
 
class  MultiPartMessage
 MultiPartMessage class implementation. More...
 
class  MultiPartMixedMessage
 implements the MultiPartMixedMessage class, a specialization of MultiPartMessage More...
 
class  MultiPartRelatedMessage
 implements the MultiPartRelatedMessage class, a specialization of MultiPartMessage More...
 

Functions

string get_mime_type_from_ext (string path, string def_type=MimeTypeUnknown)
 returns the mime type for the given filename from the extension or the default type if the extension is not present or unknown
 
bool is_filename_text (string path)
 Returns True if the given filename / path is known to provide text content, False if not.
 
bool is_mime_text (string mime)
 
binary mime_decode_base64 (data str)
 
string mime_decode_base64_to_string (data str, *string encoding)
 returns a string value from a string in "BASE64" encoding
 
string mime_decode_header (string hdr)
 decodes a header string
 
string mime_decode_quoted_printable (string str, *string encoding, *bool is_body)
 returns a string parsed from "quoted-printable" (or "QP") encoding
 
data mime_decode_transfer_data (data mime_data, string enc, *string ct, *bool is_body)
 decodes data according to the given encoding
 
string mime_decode_urlencoded_string (string str)
 decodes the given string from URL encoded format
 
string mime_encode_base64 (data str, int len=MimeBase64LineLen)
 
string mime_encode_header_word_b (string str)
 returns a string in "B" ("BASE64") encoding for MIME header string words
 
string mime_encode_header_word_q (string str)
 returns a string in "Q" ("quoted-printable") encoding for MIME header string words
 
string mime_encode_quoted_printable (string str, bool hdr=False, *string encoding)
 returns a string in "quoted-printable" (or "QP") encoding
 
data mime_encode_transfer_data (data mime_data, string enc)
 encodes data according to the given encoding
 
string mime_get_form_urlencoded_string (hash< auto > h)
 returns a string in MIME multipart form URL encoded format (for use with "Content-Type: application/x-www-form-urlencoded" data)
 
string mime_get_urlencoded_string (auto val)
 returns a single string in MIME URL encoded format
 
hash< auto > mime_parse_form_urlencoded_string (string str)
 returns a hash corresponding to the string in MIME multipart form URL encoded format (for use with "Content-Type: application/x-www-form-urlencoded" data)
 

Variables

const ContentTransEnc7Bit = "7bit"
 
const ContentTransEnc8Bit = "8bit"
 implies lines < 1000 chars (= no encoding)
 
const ContentTransEncBase64 = "base64"
 base-64 Content-Transfer-Encoding
 
const ContentTransEncBinary = "binary"
 binary transfer encoding; implies no maximum line length (= no encoding)
 
const ContentTransEncQuotedPrintable = "quoted-printable"
 quoted-printable Content-Transfer-Encoding
 
const MimeBase64LineLen = 76
 maximum line length for base64 encoding
 
const MimeQuotedPrintableLineLen = 76
 maximum line length for quoted-printable encoding
 
const MimeTypeCss = "text/css"
 Mime type for css.
 
const MimeTypeCsv = "text/csv"
 MIME type for csv files (http://tools.ietf.org/html/rfc4180)
 
const MimeTypeFormUrlEncoded = "application/x-www-form-urlencoded"
 Mime type for multipart form URL encoding.
 
const MimeTypeHtml = "text/html"
 MIME type for HTML.
 
const MimeTypeJar = "application/java-archive"
 Mime type for Java jar files.
 
const MimeTypeJava = "application/java"
 Mime type for Java class files.
 
const MimeTypeJavascript = "application/javascript"
 Mime type for Javascript.
 
const MimeTypeJavaSource = "text/x-java-source"
 Mime type for Java sources.
 
const MimeTypeJpeg = "image/jpeg"
 MIME type for jpeg images.
 
const MimeTypeJson = "application/json"
 Mime type for JSON.
 
const MimeTypeJsonRpc = MimeTypeJson
 Mime type for JSON-RPC.
 
const MimeTypeMultipartFormData = "multipart/form-data"
 Mime type for multipart form data.
 
const MimeTypeMultipartMixed = "multipart/mixed"
 Mime type for multipart mixed.
 
const MimeTypeMultipartRelated = "multipart/related"
 Mime type for multipart related.
 
const MimeTypeOctetStream = "application/octet-stream"
 MIME type for unknown file types.
 
const MimeTypePhp = "application/x-httpd-php"
 Mime type for PHP sources.
 
const MimeTypePng = "image/png"
 MIME type for png images.
 
const MimeTypePython = "text/x-python-source"
 Mime type for Python sources.
 
const MimeTypePythonCode = "application/x-python-code"
 Mime type for Python compiled code.
 
const MimeTypeQore = "text/x-qore"
 Mime type for Qore sources.
 
const MimeTypes = ...
 A map of default mime types per file extension; the hash keys are file extensions in lower-case without the dot (ex: "txt")
 
const MimeTypeSoapXml = "application/soap+xml"
 Mime type for SOAP XML messages (XML MIME type reference: http://tools.ietf.org/html/rfc3023)
 
const MimeTypeSse = "text/event-stream"
 Mime type for server-sent events.
 
const MimeTypeSvg = "image/svg+xml"
 Mime type for SVG files.
 
const MimeTypeText = "text/plain"
 MIME type for text.
 
const MimeTypeUnknown = MimeTypeOctetStream
 
const MimeTypeXml = "text/xml"
 Mime type for plain (human-readable) xml files.
 
const MimeTypeXmlApp = "application/xml"
 Mime type for more complicated (not human-readable) xml files.
 
const MimeTypeXmlRpc = MimeTypeXml
 Mime type for XML-RPC.
 
const MimeTypeYaml = "text/x-yaml"
 Mime type for yaml data files.
 
const MimeTypeYamlRpc = "application/x-yaml"
 Mime type for YAML-RPC.
 
const MPT_ALTERNATIVE = "alternative"
 for sending multiple "alternatives" of the same content (http://tools.ietf.org/html/rfc2046#section-5.1.4)
 
const MPT_BYTERANGES = "byteranges"
 for sending noncontiguous byte ranges of a single message (http://tools.ietf.org/html/rfc2616)
 
const MPT_DIGEST = "digest"
 for sending multiple text messages (http://tools.ietf.org/html/rfc2046#section-5.1.5)
 
const MPT_ENCRYPTED = "encrypted"
 for sending encrypted messages (http://tools.ietf.org/html/rfc1847#section-2.2)
 
const MPT_FORM_DATA = "form-data"
 
const MPT_MESSAGE = "message"
 for email/MIME messages with headers (http://tools.ietf.org/html/rfc2046)
 
const MPT_MIXED = "mixed"
 for sending files with different "Content-Type" headers (http://tools.ietf.org/html/rfc2046#section-5.1.3)
 
const MPT_RELATED = "related"
 for sending multiple components of an aggregated whole (http://tools.ietf.org/html/rfc2387)
 
const MPT_SIGNED = "signed"
 to attach a digital signature to a message (http://tools.ietf.org/html/rfc1847#section-2.1)
 
const UrlEncodedChars = ...
 hash of non-alphanumeric characters that can be used unencoded in URL encoded format
 

Detailed Description

public Mime namespace defines constants and functions relevant to MIME