mirror of
https://github.com/actix/examples
synced 2024-11-23 22:41:07 +01:00
.. | ||
src | ||
.env.example | ||
.gitignore | ||
Cargo.toml | ||
README.md |
Multipart + AWS S3
Upload a file in multipart form to AWS S3 using AWS S3 SDK.
Usage
cd forms/multipart-s3
- copy
.env.example
to.env
- edit
.env
keyAWS_REGION
= your_bucket_region - edit
.env
keyAWS_ACCESS_KEY_ID
= your_key_id - edit
.env
keyAWS_SECRET_ACCESS_KEY
= your_key_secret - edit
.env
keyAWS_S3_BUCKET_NAME
= your_bucket_name
cargo run
Go to http://localhost:8080 in you browser.
Or, start the upload using HTTPie:
http --form POST :8080/ file@Cargo.toml
http --form POST :8080/ file@Cargo.toml file@README.md meta='{"namespace":"foo"}'
Or, using cURL:
curl -X POST http://localhost:8080/ -F 'file=@Cargo.toml'
curl -X POST http://localhost:8080/ -F 'file=@Cargo.toml' -F 'file=@README.md' -F 'meta={"namespace":"foo"}'