pub struct File {
pub path: PathBuf,
pub filename: Option<String>,
pub size: u64,
pub content_type: Mime,
}
Expand description
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.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnwindSafe for File
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> PersistentInto<Arc<Mutex<T>>> for T
impl<T> PersistentInto<Arc<Mutex<T>>> for T
Source§fn persistent_into(self) -> Arc<Mutex<T>>
fn persistent_into(self) -> Arc<Mutex<T>>
Convert
self
into a value of type T
.Source§impl<T> PersistentInto<Arc<RwLock<T>>> for T
impl<T> PersistentInto<Arc<RwLock<T>>> for T
Source§fn persistent_into(self) -> Arc<RwLock<T>>
fn persistent_into(self) -> Arc<RwLock<T>>
Convert
self
into a value of type T
.Source§impl<T> PersistentInto<Arc<T>> for T
impl<T> PersistentInto<Arc<T>> for T
Source§fn persistent_into(self) -> Arc<T>
fn persistent_into(self) -> Arc<T>
Convert
self
into a value of type T
.Source§impl<T> PersistentInto<T> for T
impl<T> PersistentInto<T> for T
Source§fn persistent_into(self) -> T
fn persistent_into(self) -> T
Convert
self
into a value of type T
.