当前位置: 代码迷 >> QT开发 >> Qftp的上传功能,该如何处理
  详细解决方案

Qftp的上传功能,该如何处理

热度:100   发布时间:2016-04-25 04:50:35.0
Qftp的上传功能
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);
这样写上传不了~~

------解决方案--------------------
探讨
QString filename = QFileDialog::getOpenFileName(this,tr("upload file"),"*",
tr("Choose a file to upload(*.all files)") );
if ( filename.is……