Function pencil::helpers::send_file [] [src]

pub fn send_file(filepath: &str, mimetype: Mime, as_attachment: bool) -> PencilResult

Sends the contents of a file to the client. Please never pass filenames to this function from user sources without checking them first. Set as_attachment to true if you want to send this file with a Content-Disposition: attachment header. This will return NotFound if filepath is not one file.