I need help using FTP to upload files with C++

时间:2016-02-03 04:24:41

标签: c++ qt curl upload ftp

I've been looking for a way to upload a file using FTP with c++.

I'm using Qt, so I looked for a built-in function, but they're too complicated for me and I don't even understand the explanations on the help pages or the examples.

This is the example: http://doc.qt.io/qt-5/qtnetwork-download-example.html

I tried to use Curl, but when I tried to compile the example it gave me a bunch of errors that I don't understand like the following:

this was the Curl example: http://curl.haxx.se/libcurl/c/ftpupload.html

This was the error when I tried to compile:

...FTPUploader\ftpupload.cpp:35: error: invalid conversion from 'void*' to 'FILE* {aka _iobuf*}' [-fpermissive]
   size_t retcode = fread(ptr, size, nmemb, stream);
                                                  ^

I feel lost, any help is welcome, either in fixing the Curl error or helping me understand how to use Qt functions to handle FTP.

1 个答案:

答案 0 :(得分:-1)

使用Filezilla或其他任何可信的FTP。您的文件将是安全的。而不是制作y