Skip to navigation
Stream a csv file with actix_web rust
20.09.22
use actix_web::{ web, Responder, HttpRequest}; use actix_files::Files; use serde::{Serialize, Deserialize}; use qstring::QString; use async_std::fs; use std::env; pub async fn abk_bulk(_req: HttpRequest) -> impl Responder { println!("...abk_bulk"); let dir = env::current_dir().unwrap(); let path = format!("{0}/src/abk_bulk.csv",dir.display()); println!("{:?}",path); let file = actix_files::NamedFile::open_async(path).await.unwrap(); file.into_response(&_req) }
https://github.com/actix/actix-web/discussions/2720
Reply
Anonymous
Information Epoch 1742413032
Worse is better.
Home
Notebook
Contact us