954,480 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

FTP Upload using QNetworkAccessManager [QT]

Hello,

Currently, I am trying to write a program which should upload a file to an FTP server. As recommended in the QT Docu., I chose to use QNetworkAccessManager's put function instead of QFtp. As far as I know, I should be able to access the FTP Server without using any security measures.

QUrl uploadurl("ftp://ftp.drivehq.com/wwwhome/");
    uploadurl.setUserName("XXXXXX");
    uploadurl.setPassword("XXXXXX");
    uploadurl.setPort(21);
    QNetworkRequest upload(uploadurl);
    QNetworkAccessManager *uploadman = new QNetworkAccessManager(this);
    uploadman->put(upload, file);

Basically, this is the code which should perform the upload.
However, the file will not show up on the server. The file is about 1-2kb "big", and is opened as ReadWrite.
Has anybody got an idea what I am doing wrong?

Thank you for your time!

cheers
replax

replax
Newbie Poster
8 posts since Apr 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: