QNetworkManagerAccess: fails to upload file to FTP via put()
Hi everybody!
I'm trying to use QNetworkManagerAccess to upload a file. I've created a prototype (Python):
Code:
def run(self):
print "Starting thread"
self.manager = QNetworkAccessManager();
self.manager.finished.connect(self.finished)
print "Opening file"
self.
f = QFile("/home/divius/test.tbz2") self.
request = QNetworkRequest
(QUrl( "ftp://ibdftp:111111@127.0.0.1/test.tbz2"))
print "Putting request"
self.manager.put(self.request, self.f)
print "Executing"
code = self.exec_()
print "Done:", code
def finished(self, reply):
print "Finished", reply.error(), reply.error() == QNetworkReply.NoError
self.quit()
Still, I get error 201 (QNetworkReply::ContentAccessDenied).
Syslog contains:
May 17 13:55:17 divius-pc wu-ftpd[31399]: connection from localhost [127.0.0.1]
May 17 13:55:17 divius-pc wu-ftpd[31399]: USER ibdftp
May 17 13:55:17 divius-pc wu-ftpd[31399]: PASS password
May 17 13:55:17 divius-pc wu-ftpd[31399]: FTP LOGIN FROM localhost [127.0.0.1], ibdftp
May 17 13:55:17 divius-pc wu-ftpd[31399]: TYPE Image
May 17 13:55:17 divius-pc wu-ftpd[31399]: PASV
May 17 13:55:17 divius-pc wu-ftpd[31399]: ALLO 10723805
May 17 13:55:17 divius-pc wu-ftpd[31399]: STOR /test.tbz2
May 17 13:55:18 divius-pc wu-ftpd[31399]: FTP session closed
Tested with wu-ftpd, proftpd and simple ftpd.
Any ideas?
Re: QNetworkManagerAccess: fails to upload file to FTP via put()
If it's important: Ubuntu 10.04, Qt 4.6.2
Re: QNetworkManagerAccess: fails to upload file to FTP via put()
hi did you work out the solution? if so, please share code
thanks
Re: QNetworkManagerAccess: fails to upload file to FTP via put()
At a guess the FTP server is denying permission to write the uploaded file into the FTP server's "root" directory (which may be the system's root directory or a virtual one).
There are some issues with parsing of FTP URLs that were recently discussed in this forum.