Hi freinds,
i want some example code for ftp upload in qt5.3.
can any one help.
Hi freinds,
i want some example code for ftp upload in qt5.3.
can any one help.
Google can.can any one help.
I guess you find it easier to use this forum as your search engine.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
check QFtp ...
QFtp is not working in Qt5.3...
in which process can i use
You could try a QNetworkAccessManager::put() operation with an ftp URL.
Cheers,
_
Qt Code:
QNetworkAccessManager *Ftp = new QNetworkAccessManager(this); QNetworkReply *reply = new QNetworkReply (this); url.setUserName(test); url.setPassword(test); url.setPort(21); { qDebug() << "Could not open file to FTP"; return false; } else { reply = Ftp->put(QNetworkRequest(url),data); }To copy to clipboard, switch view to plain text mode
but i getting error like this
QIODevice::read: device not open
Error Code: "Unknown error"
can anybody tell why it is coming and give some solution....
Last edited by anda_skoa; 6th September 2016 at 17:03. Reason: missing [code] tags
no
it is a writable location on server
while uploading file error is coming
Ok.
So you have connected to the QNetworkReply::error() signal and it is emitted before finished()?
Where do you close/delete the "data" object? In the slot for QNetworkReply::finished()?
Maybe try "post" instead of "put".
Cheers,
_
it is showing QIODevice::read: device not open
but files uploading to server...
what is problem i am not understanding
Are you maybe calling "read" or "readAll" on the reply object?
Cheers,
_
i am not calling read or readall
when file is given QIODevice::readonly i given..
QFile *data = new QFile(test.txt);
if(!data->open(QIODevice::ReadOnly))
{
qDebug() << "Could not open file to FTP";
QMessageBox::information(this,"FTP ","Could not open file to FTP");
return ;
}
reply = Ftp->put(QNetworkRequest(url),data);
where data is QFile
reply is qnetworkreply
ftp is qnetworkacessmanager...
Bookmarks