I am confusing of uploading file to server.
I want know how I specified the path in the server.The file ,that will be uploaded,should be open,and copy to memory,then upload to the file which I created in the server...
May be I don't explain it clear,I just want to konw the process how the file upload to the server.
Thank you!!
int i = 0;
"D://");
if (files.isEmpty())
return;
while(files.indexOf("/", i) != (-1)) //find the file name not include the full url
i = files.indexOf("/",i) + 1;
while(i < files.size())
{
filename.append(files.at(i));
i++;
}
file = new QFile(filename
);
Q_ASSERT(file != NULL);
if(!file
->open
(QIODevice::ReadWrite)) //finished create the file in the debug file {
qDebug() << "opern err" << file->fileName();
return;
}
ftp->put(file,filename);
int i = 0;
QString filename;
QString files = QFileDialog::getOpenFileName(this, tr("Select File"),
"D://");
if (files.isEmpty())
return;
while(files.indexOf("/", i) != (-1)) //find the file name not include the full url
i = files.indexOf("/",i) + 1;
while(i < files.size())
{
filename.append(files.at(i));
i++;
}
file = new QFile(filename);
Q_ASSERT(file != NULL);
if(!file->open(QIODevice::ReadWrite)) //finished create the file in the debug file
{
qDebug() << "opern err" << file->fileName();
return;
}
ftp->put(file,filename);
To copy to clipboard, switch view to plain text mode
After the ftp->put , I find there is no file in the server directory.
Bookmarks