Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 1.11 KB

README.md

File metadata and controls

28 lines (21 loc) · 1.11 KB

Actix Easy Multipart

Build status crates.io docs.rs

Easy to use Multipart Forms for actix-web.

File uploads are written to disk as temporary files similar to the way the $_FILES variable works in PHP.

Example

use actix_web::Responder;
use actix_easy_multipart::{MultipartFile, FromMultipart};
use actix_easy_multipart::extractor::MultipartForm;

#[derive(FromMultipart)]
struct Upload {
   description: String,
   image: MultipartFile,
}

async fn route(form: MultipartForm<Upload>) -> impl Responder {
    format!("Received image of size: {}", form.image.size)
}