I’ve made a small program in C++ and Qt. The program displays a list of names which will be updated over time. The requirement is that this list of names is stored on a website and my program should download this file and display the list in the program. I have little experience with network programming and Qt.
My idea is to store the list in a text file on the web server and use one of the modules provided in Qt (QDownload?) to download the file locally and display the list. However, my concern is security. I’d like to know whether this is the best approach and what possible security risks (if any) are involved.
To actually download the file you could take a look at this example. You’d want to look at the
QNetworkAccessManager,QNetworkRequestand theQNetworkReplyclasses. The example sends a GET request to the server and awaits a result.In a nutshell you create the manager and hook the signal:
Then you give the request:
And when the file has been downloaded then you can read your data from the
QNetworkReplyobject:The security risks depends on your situation. Perhaps you would want to elaborate on which security criteria you need fulfilled? For instance, if you don’t want others to read it then you might want to consider encrypting it.