• This repository has been archived on 14/Feb/2023
  • Stars
    star
    190
  • Rank 203,739 (Top 5 %)
  • Language
    Rust
  • License
    MIT License
  • Created about 10 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A backend-agnostic extension for file uploads in HTTP libraries for Rust

Multipart Build Status On Crates.io

Client- and server-side abstractions for HTTP file uploads (POST requests with Content-Type: multipart/form-data).

Supports several different (synchronous API) HTTP crates. Asynchronous (i.e. futures-based) API support will be provided by multipart-async.

Minimum supported Rust version: 1.36.0
Maintenance Status: Passive

As the web ecosystem in Rust moves towards asynchronous APIs, the need for this crate in synchronous API form becomes dubious. This crate in its current form is usable enough, so as of June 2020 it is now in passive maintenance mode; bug reports will be addressed as time permits and PRs will be accepted but otherwise no new development of the existing API is taking place.

Look for a release of multipart-async soon which targets newer releases of Hyper.

Documentation

Integrations

Example files demonstrating how to use multipart with these crates are available under examples/.

Hyper

via the hyper feature (enabled by default).

Note: Hyper 0.9, 0.10 (synchronous API) only; support for asynchronous APIs will be provided by multipart-async.

Client integration includes support for regular hyper::client::Request objects via multipart::client::Multipart, as well as integration with the new hyper::Client API via multipart::client::lazy::Multipart (new in 0.5).

Server integration for hyper::server::Request via multipart::server::Multipart.

Iron

via the iron feature.

Provides regular server-side integration with iron::Request via multipart::server::Multipart, as well as a convenient BeforeMiddleware implementation in multipart::server::iron::Intercept.

Nickel returning to multipart in 0.14!

via the nickel feature.

Provides server-side integration with &mut nickel::Request via multipart::server::Multipart.

tiny_http

via the tiny_http feature.

Provides server-side integration with tiny_http::Request via multipart::server::Multipart.

Rocket

Direct integration is not provided as the Rocket folks seem to want to handle multipart/form-data behind the scenes which would supercede any integration with multipart. However, an example is available showing how to use multipart on a Rocket server: examples/rocket.rs

⚑ Powered By ⚑

buf_redux

Customizable drop-in std::io::BufReader replacement, created to be used in this crate. Needed because it can read more bytes into the buffer without the buffer being empty, necessary when a boundary falls across two reads. (It was easier to author a new crate than try to get this added to std::io::BufReader.)

httparse

Fast, zero-copy HTTP header parsing, used to read field headers in multipart/form-data request bodies.

twoway

Fast string and byte-string search. Used to find boundaries in the request body. Uses SIMD acceleration when possible.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

More Repositories

1

img_hash

A Rust library for calculating perceptual hash values of images
Rust
314
star
2

mime_guess

MIME type guessing of file extensions for Rust.
Rust
155
star
3

anterofit

Strongly typed, asynchronous REST client framework for Rust.
Rust
134
star
4

multipart-async

Multipart requests with an asynchronous API.
Rust
72
star
5

img-dup

A tool for finding duplicate and similar images, written in Rust
Rust
55
star
6

buf_redux

A drop-in replacement for Rust's std::io::BufReader, with extra features
Rust
39
star
7

readme-doctest-poc

Automatically test Rust code examples in your README
Rust
21
star
8

const-cstr

Create static C-compatible strings from Rust string literals.
Rust
16
star
9

ferrite

Predecessor to Anterofit (https://github.com/abonander/anterofit)
Rust
13
star
10

safemem

Safe wrappers for `memmove`, `memset`, etc. in Rust
Rust
11
star
11

rawr

Reddit API Wrapper for Rust. HTTP-client-agnostic.
Rust
8
star
12

wingui

A safe Rust wrapper for the Windows GUI
Rust
7
star
13

vec-vp-tree

A vantage-pont-tree backed by a contiguous `Vec` for better data locality.
Rust
4
star
14

rust-what-now

A newbie's field guide to contributing to the Rust ecosystem.
4
star
15

fontconfig-rs

A wrapper around freedesktop's fontconfig utility, for locating fontfiles on a Linux-based system. Requires libfontconfig to be installed.
Rust
4
star
16

file_dialog

A file dialog in Rust using Conrod
Rust
3
star
17

mvp-tree-rs

A multi-vantage point (MVP) tree for Rust.
Rust
2
star
18

thread-stack

A concurrent stack datastructure for Rust which uses a thread's stack as the backing storage.
Rust
1
star
19

better_unwraps

Rust
1
star
20

dbl-buf

Generic double-buffer for Rust
Rust
1
star
21

img-hash-extern

Rust
1
star
22

async-mlock-poc

Rust
1
star
23

display_bytes

Rust
1
star
24

py-emulatorlib

A Python 3 wrapper for the telnet commands exposed by the Android emulator.
1
star