Results 1 to 2 of 2

Thread: Read content from text file on web server and save in QString?

  1. #1
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    30
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Read content from text file on web server and save in QString?

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Read content from text file on web server and save in QString?

    Just use QNetworkAccessManager::get() and just convert the content of the reply to a QString.

    Cheers,
    _

Similar Threads

  1. Replies: 2
    Last Post: 16th January 2015, 19:34
  2. Replies: 1
    Last Post: 30th November 2012, 17:54
  3. read ini file content and save into array
    By cooper in forum Newbie
    Replies: 8
    Last Post: 14th March 2011, 21:33
  4. QDomDocument can't read the file content
    By baluk in forum Newbie
    Replies: 21
    Last Post: 24th September 2010, 13:43
  5. How to modify the content of text file
    By grsandeep85 in forum Qt Programming
    Replies: 3
    Last Post: 31st July 2009, 10:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.