Following program is to upload a file from local system to a remote sever.But the file on server after uploading have zero bytes.Correct uploading take place only when i put the file to upload in my application's release folder.Changing the current directory failed.Please help me..
if(QDir::setCurrent(path
)) qDebug()<<"path set";
else
qDebug()<<"Couldn't set path";
ftp.connectToHost("192.100.1.00");
ftp.login("ftp","ftp");
ftp.
put(file,fi.
fileName(),
QFtp::Binary);
ftp.close();
if(QDir::setCurrent(path))
qDebug()<<"path set";
else
qDebug()<<"Couldn't set path";
QFile *file = new QFile(filename);
file->open( QIODevice::ReadWrite );
ftp.connectToHost("192.100.1.00");
ftp.login("ftp","ftp");
QFileInfo fi(media);
ftp.put(file,fi.fileName(),QFtp::Binary);
ftp.close();
To copy to clipboard, switch view to plain text mode
Bookmarks