![]() |
Qore Mime Module Reference 1.6.1
|
Functions | |
string | Mime::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 | Mime::is_filename_text (string path) |
Returns True if the given filename / path is known to provide text content, False if not. | |
bool | Mime::is_mime_text (string mime) |
string | Mime::mime_decode_urlencoded_string (string str) |
decodes the given string from URL encoded format | |
string | Mime::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::mime_get_urlencoded_string (auto val) |
Returns a single string in MIME URL encoded format. | |
hash< auto > | Mime::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) | |
bool Mime::is_filename_text | ( | string | path | ) |
bool Mime::is_mime_text | ( | string | mime | ) |
string Mime::mime_decode_urlencoded_string | ( | string | str | ) |
decodes the given string from URL encoded format
str | the URL encoded string to decode |
string Mime::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)
Parameters will be separated by "&"
characters. All key values must be strings or convertible to strings or a URLENCODED-TYPE-ERROR exception is thrown
h | the hash to use to generate the string |
application/x-www-form-urlencoded
formatURLENCODED-TYPE-ERROR | hash value cannot be converted to a string |
INVALID-CHARACTER | an invalid character has been found |
string Mime::mime_get_urlencoded_string | ( | auto | val | ) |
Returns a single string in MIME URL encoded format.
The string is converted to UTF-8, if necessary, and then the encoded version is returned; reserved characters are replaced with percent encoding, characters outside the ASCII character are encoded with their UTF-8 bytes with binary encoding (ex: "%C3%B6" for "รถ")
val | the input value |
INVALID-VALUE | the value given cannot be converted to a string |
'+'
signs but rather encoded as %20
because '+'
signs are often encoded and decoded improperly in URLs, and %20
is unambiguoushash< auto > Mime::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)
str | the string to parse |
URLENCODED-PARSE-ERROR | cannot parse the given string |