QString filename = QFileDialog::getOpenFileName(this,tr("upload file"),"*",
tr("Choose a file to upload(*.all files)") );
if ( filename.isNull() )
return;
file = new QFile( filename );
if ( !file->open(QIODevice::ReadOnly) )
{
QMessageBox::critical( this, tr("Upload error"),
tr("Can't open file '%1' for reading.").arg(filename) );
delete file;
return;
}
ftp->put(file,filename);
这样写上传不了~~
------解决方案--------------------