drogonframework / drogonframework/drogon

Downloading of files from file response in HttpClient

Open
#1,818 1 comment 5 reactions 0 assignees View on GitHub
documentation enhancement
Dominant language
C++
Stars
14.3k
Forks
1.4k
Avg merge
1d 13h
Merged PRs (30d)
14

Description

Hello,

I'm writing an application including both server and client based on Drogon. Among all use cases there is one when the client uploads files to the server and another when the client downloads files from server.

And here comes the problem, because there are no documentation and good examples of file transmission, especially for HttpClient.

The part of uploading files to server could still be achieved as I found some files in the Drogon repository which helped me:

- for server:
- from examples: https://github.com/drogonframework/drogon/blob/master/examples/file_upload/file_upload.cc
- from integration tests: https://github.com/drogonframework/drogon/blob/master/lib/tests/integration_test/server/api_Attachment.cc
- for client:
- from integration tests: https://github.com/drogonframework/drogon/blob/master/lib/tests/integration_test/client/main.cc#L696-L729

However I found no explanation how to download files by the client. All I found until now is:

- for server:
- from integration tests: https://github.com/drogonframework/drogon/blob/master/lib/tests/integration_test/server/api_Attachment.cc#L106-L112
- for client:
- from integration tests: https://github.com/drogonframework/drogon/blob/master/lib/tests/integration_test/client/main.cc#L661-L670

So the example from server integration tests is quite useful, because everything needed is there. But the example from client integration test is useless, because the file send in file response is not downloaded at all.

I think it's not good that you have to search for examples of usage of basic functionalities of the software in integration tests and the rest of source code. There are Wiki and examples directory, 2 ideal places to put some short functional examples for it 🙂

To sum up, my requests are:

1. Is it possible to add functional examples of files uploading and downloading for client placed in the repo in examples directory?
2. Is it possible to add a documentation (in Wiki) of file transmission regarding both sides, server and client?
3. Can anyone share the implementation of downloading files on client side?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.