Multipart file upload error on Lambda. #2886
Unanswered
uygunbodur
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bug Report
Version
axum = { version = "0.7.5", features = ["multipart"] }
├── axum v0.7.5 │/tmp/db630554-670d-4dff-999f-cf92afe0cc30th2.jpeg
│ ├── axum-core v0.4.3
Platform
Linux
Handler: rust.handler
Runtime: provided.al2023
Crates
axum = { version = "0.7.5", features = ["multipart"] }
chrono = "0.4.38"
dotenv = "0.15.0"
jsonwebtoken = "9.3.0"
lambda_http = "0.13.0"
rand = "0.8.5"
serde = { version = "1.0.204", features = ["derive"] }
serde_json = "1.0.120"
sha2 = "0.10.8"
sqlx = { version = "0.8.0", features = ["runtime-tokio-rustls", "postgres","uuid"] }
once_cell = "1.19.0"
tokio = { version = "1", features = ["macros", "full"] }
tower-http = { version = "0.5.2", features = ["trace", "cors","limit"] }
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
uuid = { version = "1.10.0", features = ["v4","serde"] }
aws-config = { version = "1.5.5", features = ["behavior-version-latest"] }
aws-sdk-s3 = "1.46.0"
Description
I'm working on an API with Rust Axum Lambda, trying to save files to S3. There's no issue on my local machine, but on Lambda, the file size received from multipart is nearly twice as large as the original file, and the file saved to S3 is corrupted.
pub async fn upload(mut multipart: Multipart) -> Result<Json, AppError> {
}
pub async fn upload_file(multipart: &mut Multipart) -> Result<String, Box> {
let config = aws_config::load_defaults(BehaviorVersion::v2024_03_28()).await;
let s3_client = aws_sdk_s3::Client::new(&config);
let bucket_name = BUCKET.to_string();
tracing::info!("---> {}", bucket_name);
}
Beta Was this translation helpful? Give feedback.
All reactions