The file_transfer project completes the file_transfer_stub project, by filling in the missing features.
The features were omitted in the previous project for the following reasons:
- To have a very simple service that actually does not really access the filesystem
- To have only synchronous processing
- To ignore any kind of failure, and keep the code simple
Here, these restrictions have been removed. First of all, let's see what happens if you compile and run the file_transfer project, and then test it using the same commands as in the previous section.
Downloading a file
Let's try the following steps on how to download a file:
- Type the following command into the console:
curl -X GET http://localhost:8080/datafile.txt
- If the download is successful, the server prints the following line to the console:
Downloading file "datafile.txt" ... Downloaded file "datafile.txt"
In the console of the client, curl prints the contents of...