Using SFTP for transferring files
I hava one mobile aplication that use SQLite, and i want add one funcition to refresh this database. I make the upgrade and download with telenet and tcp protocol, but i want use SFTP to more security, somebody know any simple method to use that?
(Sorry for my english, i am brasilian)
Re: Refresh databases files
Your thread title is very misleading.
You are asking about SFTP and your thread title says database.
Let see if we can fix that.
Cheers,
_
Re: Using SFTP for transferring files
Have a look at libssh2 http://www.libssh2.org/. They have examples for SFTP access that you can modify for your Qt project.
Regards
ars
Re: Using SFTP for transferring files
I download the libssh2, but i cannot add the libssh2.h. I have to do something before, for configurate the Qt? Thanks.
Re: Using SFTP for transferring files
What do you mean by
Quote:
i cannot add the libssh2.h
You add
Code:
#include "libssh2.h"
to the cpp file that accesses libssh2 functions and data types. Make sure that you have set the include path in your qmake file, s.th. like
Code:
INCLUDEPATH += "path to libssh2 include directory"
For linking you also have to specify the library:
Code:
LIBS += -Labsolute_path_to_directory_containing_libssh2_library -lname_of_the_libssh2_library
After these modifications, rerun qmake to update your Makefile(s).
Sorry, I'm not an expert with qmake as I'm using plain makefiles. For more details see e.g. http://doc.qt.io/qt-4.8/qmake-variable-reference.html.
Best regards
ars
Re: Using SFTP for transferring files
I try put "#include libshh2.h" but i receive one error when compile "no such file or directory".
Exist severals "qmake's" how can i know which one is right?
Re: Using SFTP for transferring files
ok, in the project folder of your Qt project you should have a *.pro file. Open this file and add the include path and lib specifications as suggested in my previous mail.
Next you have to run qmake again to update your makefiles. If you miss that step, you will get the error message again. After that, rebuild your project.
Please note: You should build the libssh2 library before adding it to your project. Follow the build instructions given for libssh2.