PDA

View Full Version : How to use QNetworkAccessManager



lni
15th June 2016, 14:29
Hello,

I am using QNetworkAccessManager to ftp files. How do I skip the symbolic files? I just want to ftp the actual physical files, not the symbolic link files.

Thanks!

jefftee
15th June 2016, 15:21
Look at QFileInfo::isSymLink()

lni
15th June 2016, 15:37
Look at QFileInfo::isSymLink()

There is no method to get QFileInfo or QUrlInfo from the QNetwork module...

jefftee
15th June 2016, 16:34
There is no method to get QFileInfo or QUrlInfo from the QNetwork module...Nor did I say there was. I had assumed you are sending files via FTP, so if that's the case, you have a file path which you could use QFileInfo to determine if the file/directory is a symbolic link.

If you're receiving files via FTP, then that would be up to the sending client/server to skip files that may be symbolic links. i.e. How would you know on the receiving end if the file was a symbolic link on the sending system?

lni
15th June 2016, 19:34
I am at the receiving side. Some of files in sending side are symbolic link which I don't want to ftp. So I am trying to figure out how to know if a file at remote sending site is a symbolic link so I can skip it. The sending site allows the symbolic link files to be sent...

jefftee
15th June 2016, 20:12
As you have found, QNetwork* doesn't care or even know if the remote file is a symbolic link or not, so you'll have to determine that on your own and request only the files that are not symbolic links to be transferred. Once the file has been transferred to your local system, it will be a regular file, even if the source was a symbolic link.