Expand description
Content-Disposition (RFC 6266, and its use in multipart/form-data
part headers, RFC 7578 section 4.2).
§Examples
use parse_net as pn;
let cd = pn::parse_content_disposition(
b"attachment; filename=\"EURO rates.txt\"; filename*=utf-8''%e2%82%ac%20rates.txt")?;
assert_eq!(cd.kind(), pn::DispositionType::Attachment);
let mut buf = [0u8; 64];
assert_eq!(cd.filename().expect("present").decode_into(&mut buf)?, "\u{20ac} rates.txt");Structs§
- Content
Disposition - A validated
Content-Dispositionvalue.
Enums§
- Disposition
Type - The disposition type.
- Filename
- A file name from
Content-Dispositionor aLinktitle.
Functions§
- parse
- Parses
disposition-type *( OWS ";" OWS disposition-parm ). - parse_
content_ disposition - Parses
Content-Dispositionwith the defaultLimits. - write_
attachment - Writes
attachment; filename="<ASCII fallback>", followed by; filename*=UTF-8''<encoded>when the name is not plain printable ASCII without"and\. The fallback replaces each such character with_.