Struct params::File
[−]
[src]
pub struct File { pub path: PathBuf, pub filename: Option<String>, pub size: u64, pub content_type: Mime, }
An uploaded file that was received as part of multipart/form-data
parsing.
Files are streamed to disk because they may not fit in memory.
Fields
path: PathBuf
The path to the temporary file where the data was saved.
filename: Option<String>
The filename that was specified in the request, unfiltered.
Warning
This may or may not be legal on the local filesystem, and so you should not blindly
append it to a Path
, as such behavior could easily be exploited by a malicious client.
size: u64
The size of the file, in bytes.
content_type: Mime
Get the MIME type (Content-Type
value) of this file, if supplied by the client, or
"applicaton/octet-stream"
otherwise.
Warning
You should treat this value as untrustworthy because it can be spoofed by the client.
Methods
impl File
[src]
Trait Implementations
impl FromValue for File
[src]
Extracts from File
variant.
fn from_value(value: &Value) -> Option<File>
[src]
Returns Some
if the conversion was successful, None
otherwise.
impl Clone for File
[src]
fn clone(&self) -> File
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for File
[src]
impl PartialEq for File
[src]
Checks only for equality of the file's path.