Results 1 to 4 of 4

Thread: QNetworkManagerAccess: fails to upload file to FTP via put()

  1. #1
    Join Date
    May 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Angry 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):

    Qt Code:
    1. class Thread(QThread):
    2. def run(self):
    3. print "Starting thread"
    4. self.manager = QNetworkAccessManager();
    5. self.manager.finished.connect(self.finished)
    6. print "Opening file"
    7. self.f = QFile("/home/divius/test.tbz2")
    8. self.f.open(QIODevice.ReadOnly)
    9. self.request = QNetworkRequest(QUrl(
    10. "ftp://ibdftp:111111@127.0.0.1/test.tbz2"))
    11. print "Putting request"
    12. self.manager.put(self.request, self.f)
    13. print "Executing"
    14. code = self.exec_()
    15. print "Done:", code
    16.  
    17. def finished(self, reply):
    18. print "Finished", reply.error(), reply.error() == QNetworkReply.NoError
    19. self.quit()
    To copy to clipboard, switch view to plain text mode 

    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?

  2. #2
    Join Date
    May 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QNetworkManagerAccess: fails to upload file to FTP via put()

    If it's important: Ubuntu 10.04, Qt 4.6.2

  3. #3
    Join Date
    Nov 2012
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: QNetworkManagerAccess: fails to upload file to FTP via put()

    hi did you work out the solution? if so, please share code
    thanks

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default 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.

Similar Threads

  1. QFtp:upload file to server
    By ensky_cy in forum Qt Programming
    Replies: 6
    Last Post: 14th December 2009, 10:42
  2. Qhttp Upload file
    By danny.lesnik in forum Qt Programming
    Replies: 5
    Last Post: 11th December 2009, 09:02
  3. QNetworkRequest file upload -- please help
    By Runtime Technologies in forum Qt Programming
    Replies: 3
    Last Post: 14th July 2009, 15:55
  4. Replies: 5
    Last Post: 20th January 2009, 14:11
  5. how to use qftp to upload file in just one procedure?
    By cxl2253 in forum Qt Programming
    Replies: 4
    Last Post: 23rd April 2007, 09:57

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.