QT C++ - FTP Upload -


i've got problem programming easy ftp-upload in qt. using qt 5.5 , qftp class no longer available. used code working in visual c++ project.

  1. image: code visual c++ code visual c++

  2. image: code in qt image: code in qt

  3. image: build error in qt image: build error in qt

is there way can fix problem? possible qftp working in qt 5.5?

(string filetoupload file path)

(string filename name of file on remote machine when uploaded)

thanks in advance!

your compilation error related conversion of const char* const wchar_t*. if satisfied ftpputfilew can convert file name wchar_t*. can done using qt qstring: qstring::towchararray(wchar_t * array) convert string wchar_t array (this function not append null character) or using direct cast:

reinterpret_cast<const wchar_t *>(qstring.utf16()) 

also possible use various approaches conversion of std::string wchar_t*.

if need ftp put operation qnetworkmanager has such function. however, qnetworkmanager has limited support low level ftp: https://stackoverflow.com/a/32568786/4023446

so, other low level ftp commands possible install manually qt ftp.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -