2022-03-06 01:41:32 +01:00
|
|
|
# Multipart + AWS S3
|
|
|
|
|
2022-08-01 02:17:59 +02:00
|
|
|
Upload a file in multipart form to AWS S3 using [AWS S3 SDK](https://crates.io/crates/aws-sdk-s3).
|
2022-03-06 01:41:32 +01:00
|
|
|
Receive multiple data in multipart form in JSON format and receive it as a struct.
|
|
|
|
|
|
|
|
# Usage
|
2020-02-06 02:51:22 +01:00
|
|
|
|
2022-08-01 02:17:59 +02:00
|
|
|
```sh
|
2021-10-06 23:28:53 +02:00
|
|
|
cd forms/multipart-s3
|
2020-02-06 02:51:22 +01:00
|
|
|
```
|
|
|
|
|
2022-03-06 01:41:32 +01:00
|
|
|
1. copy .env.example .env
|
2022-08-01 02:17:59 +02:00
|
|
|
1. edit .env AWS_ACCESS_KEY_ID=your_key
|
|
|
|
1. edit .env AWS_SECRET_ACCESS_KEY=your_key
|
|
|
|
1. edit .env AWS_S3_BUCKET_NAME=your_chosen_region
|
2022-03-06 01:41:32 +01:00
|
|
|
|
2022-08-01 02:17:59 +02:00
|
|
|
```sh
|
|
|
|
cargo run
|
2020-02-06 02:51:22 +01:00
|
|
|
```
|
2022-03-06 01:41:32 +01:00
|
|
|
|
2022-08-01 02:17:59 +02:00
|
|
|
<http://localhost:8080>
|