Question

When moving files around locally within my project I'm able to use

return QFile::copy(fromPath, toPath);

I need to do something similar but with the fromPath being located on the web.

What is the best way to accomplish this?

Was it helpful?

Solution

QFile works with local file only.

If you want to copy remote file from web, then you need to download it using QNetworkAccessManager

OTHER TIPS

Install on your source and destination machine ssh. Then do a scp via QProcess. This is one way. The best? Depends on your requirements. You can also write a program for your destination machine, which accepts incoming TCP connections from your source machine. Then you connect via QTcpSocket and send your data. Qt4 has a QFtp class. Never used it. Is also a dead end, since it does not exist anymore in Qt5. But maybe it is good enough for your current needs.

I hope you did not expect a more specific answer. There is not 'remoteQFile::copy' command. And there is no general 'best way'.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top