|
|
|
@ -258,7 +258,7 @@ void ExportDataThread::check_save_dir(std::string dir_path)
|
|
|
|
|
string tempPath = dir_path.substr(0, pos + 1);
|
|
|
|
|
FtpCreateDirectoryA(hftp, tempPath.c_str());
|
|
|
|
|
}
|
|
|
|
|
FtpSetCurrentDirectoryA(hftp, dir_path.c_str());
|
|
|
|
|
//FtpSetCurrentDirectoryA(hftp, dir_path.c_str());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -290,7 +290,7 @@ void ExportDataThread::ConnectServer(QString srcPath, QString destPath) {
|
|
|
|
|
string destFileName = remotePath.substr(pos + 1);
|
|
|
|
|
string tempPath = remotePath.substr(0, pos + 1);
|
|
|
|
|
check_save_dir(tempPath);
|
|
|
|
|
if (!FtpPutFileA(hftp, filePath.c_str(), destFileName.c_str(), FTP_TRANSFER_TYPE_BINARY, 0))
|
|
|
|
|
if (!FtpPutFileA(hftp, filePath.c_str(), remotePath.c_str(), FTP_TRANSFER_TYPE_BINARY, 0))
|
|
|
|
|
qDebug() << "ftp put file failed because" << dw;
|
|
|
|
|
}
|
|
|
|
|
// 上传源为一个文件夹
|
|
|
|
@ -306,6 +306,13 @@ void ExportDataThread::ConnectServer(QString srcPath, QString destPath) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ExportDataThread::GetDataFromSaveThread(QString filePath) {
|
|
|
|
|
QString remotePath;
|
|
|
|
|
remotePath = filePath.mid(filePath.indexOf("image") - 1);
|
|
|
|
|
ConnectServer(filePath, remotePath);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//*****************************************已经调试好,没有理清逻辑前不要动**********************
|
|
|
|
|
void ExportDataThread::GetFiles(string path, std::vector<string>& files) {
|
|
|
|
|
//文件句柄
|
|
|
|
@ -334,6 +341,7 @@ void ExportDataThread::GetFiles(string path, std::vector<string>& files) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
BOOL ExportDataThread::FtpUploadPic(uchar *buffer, string remotePath) {
|
|
|
|
|
DWORD dwBytesReturn = 0;
|
|
|
|
|
DWORD UploadDataSize = 0;
|
|
|
|
@ -370,4 +378,5 @@ BOOL ExportDataThread::FtpUploadPic(uchar *buffer, string remotePath) {
|
|
|
|
|
delete[] buffer;
|
|
|
|
|
CloseHandle(hFile);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*/
|