You need not use a QString for holding the file, better use a QByteArray, otherwise you can run into issues with encoding and locales. If you use UDP to transfer a file a package loss on the network will mean lost data. Use TCP if you need all packages to arrive.