PDA

View Full Version : Read content from text file on web server and save in QString?



dobedidoo
17th December 2015, 10:57
Hi,

Does anyone know of some fairly simple way of reading the content of a (text) file placed on a web server and saving the content (text) in a QString? I'd prefer not to first download the file, save it somewhere locally and then read the file content but rather to directly read file content from the server and save into a QString.

I assume this could be done for example using Qt Network, somehow?

Many thanks in advance.

anda_skoa
17th December 2015, 11:26
Just use QNetworkAccessManager::get() and just convert the content of the reply to a QString.

Cheers,
_