QByteArray, as its name suggests, contains an array of bytes. It doesn't care about what the data is or how its formatted. It's just a sequence of raw, unformatted bytes.
What are you actually trying to do?
QByteArray, as its name suggests, contains an array of bytes. It doesn't care about what the data is or how its formatted. It's just a sequence of raw, unformatted bytes.
What are you actually trying to do?
When client connects to the server the client firstly receives QStringList from server, then it sends many files one by one. I want to do this like this:client doesn't know what he will get, he only by checking the QByteArray he received he should know what to do.
Last edited by camol; 18th March 2011 at 09:08.
Right, so you need to develop a protocol which supports what you want to do.
For example, the http protocol sends the text string "Content-length" so that clients know the amount of data to expect, and strings such as "Content-Disposition: attachment; filename='filename.ext'". So the client knows a default filename before asking the user if they wish to rename it.
Once you had sent the data for all files, you can begin data transfer of the files. Its a good idea to use a synchronisation (expected sequence of bytes) so the client knows they have received each file correctly.
Bookmarks