Skip to main content

make_content_disposition

Function make_content_disposition 

Source
pub fn make_content_disposition(
    content_disposition: Option<&ContentDisposition>,
    content_type: Option<&str>,
    filename: Option<&str>,
) -> ContentDisposition
Expand description

creates the final Content-Disposition based on whether the filename exists or not, or if a requested filename was specified (media download with filename)

if filename exists: Content-Disposition: attachment/inline; filename=filename.ext

else: Content-Disposition: attachment/inline