replax 0 Newbie Poster

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.