harzemli
harzemli

Reputation: 29

QnetworkAccessManager send folder

QNetworkAccessManager *manager = new QNetworkAccessManager(this);

connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(QNetworkReply*));

QUrl urlup("ftp://127.0.0.1/tempdata.txt);
urlup.setPassword("xxxx");
urlup.setUserName("user");
QFile *data = new QFile("D:\\tempdata.txt, this);
if(data->open(QIODevice::ReadOnly))
{
  QNetworkRequest request(urlup);
  reply = manager->put(request, data);
}

I use QT5.3 and I can upload files with this code block.But I want to upload a folder that has consist of several files. How to send a folder.

Upvotes: 1

Views: 870

Answers (1)

Max Go
Max Go

Reputation: 2102

FTP protocol doesn't support uploading of directories. Here it's list of available commands.

You should locate all files in the directory and send them one by one.

Upvotes: 1

Related Questions