content_type -> mime_type

This commit is contained in:
2025-11-22 04:00:21 +01:00
parent 5871c7ae6e
commit 138e46a286
10 changed files with 34 additions and 28 deletions
+4 -4
View File
@@ -200,7 +200,7 @@ pub async fn upload_document(
let user_id = user_id;
let mut file_bytes: Option<Vec<u8>> = None;
let mut original_name: Option<String> = None;
let mut content_type: Option<String> = None;
let mut mime_type: Option<String> = None;
let mut folder_id: Option<Uuid> = None;
let mut metadata: Value = Value::Object(Default::default());
let mut tag_ids: Vec<Uuid> = Vec::new();
@@ -219,7 +219,7 @@ pub async fn upload_document(
Some("file") => {
let file_name = field.file_name().map(|n| n.to_string());
original_name = file_name.clone();
content_type = field.content_type().map(|mime| mime.to_string());
mime_type = field.content_type().map(|mime| mime.to_string());
let data = field.bytes().await.map_err(|err| {
let msg = format!("failed to read file bytes: {err}");
error!(error = %err, "failed to read file bytes");
@@ -348,7 +348,7 @@ pub async fn upload_document(
let request = DocumentUploadRequest {
bytes: file_bytes,
original_name,
content_type,
mime_type,
folder_id,
metadata,
title_override,
@@ -689,7 +689,7 @@ pub async fn download_with_token(
&version.s3_key,
disposition.as_deref(),
headers.get(header::RANGE).cloned(),
doc.content_type.as_deref(),
doc.mime_type.as_deref(),
Some(version.id.to_string()),
)
.await