This commit is contained in:
2023-08-09 17:32:32 +02:00
parent 9c56a2a12c
commit e66a1e1343

View File

@@ -50,9 +50,6 @@ pub async fn upload_to_telegram_files(
let headers = data_response.headers(); let headers = data_response.headers();
log::info!("{:?}", data_response.status());
log::info!("{:?}", headers);
let file_size = headers let file_size = headers
.get(header::CONTENT_LENGTH) .get(header::CONTENT_LENGTH)
.unwrap() .unwrap()
@@ -68,11 +65,12 @@ pub async fn upload_to_telegram_files(
.to_string(); .to_string();
let part = Part::stream(data_response) let part = Part::stream(data_response)
.file_name(filename); .file_name(filename.clone());
let form = Form::new() let form = Form::new()
.text("caption", caption) .text("caption", caption)
.text("file_size", file_size) .text("file_size", file_size)
.text("filename", filename)
.part("file", part); .part("file", part);
let response = reqwest::Client::new() let response = reqwest::Client::new()