how can i use HttpResponse to response a file stream to download #2861
Answered
by
robjtede
bouyeijiang
asked this question in
Q&A
Replies: 1 comment
-
async fn handler(req: HttpRequest) -> impl Responder {
let file = NamedFile::open_async("foo.txt").await.unwrap();
let res: HttpResponse = file.into_response(&req);
...
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
robjtede
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
i need to use file open stream to response the httpresponse download file.anybody give me a suggest?
Beta Was this translation helpful? Give feedback.
All reactions