Results 1 to 7 of 7

Thread: Using SFTP for transferring files

  1. #1
    Join Date
    May 2015
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows Android

    Default 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)
    Last edited by felipe.c.sousa; 2nd July 2015 at 13:46.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default 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,
    _

  3. #3
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    120
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default 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

  4. #4
    Join Date
    May 2015
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows Android

    Default 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.

  5. #5
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    120
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Using SFTP for transferring files

    What do you mean by
    i cannot add the libssh2.h
    You add
    Qt Code:
    1. #include "libssh2.h"
    To copy to clipboard, switch view to plain text mode 
    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
    Qt Code:
    1. INCLUDEPATH += "path to libssh2 include directory"
    To copy to clipboard, switch view to plain text mode 
    For linking you also have to specify the library:
    Qt Code:
    1. LIBS += -Labsolute_path_to_directory_containing_libssh2_library -lname_of_the_libssh2_library
    To copy to clipboard, switch view to plain text mode 

    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

  6. #6
    Join Date
    May 2015
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows Android

    Default 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?

  7. #7
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    120
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default 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.

Similar Threads

  1. QScrollarea events transferring to scrollbar
    By babu198649 in forum Qt Programming
    Replies: 15
    Last Post: 6th September 2013, 22:33
  2. Transferring data to QMap
    By saad_saadi in forum Qt Programming
    Replies: 10
    Last Post: 4th September 2013, 07:10
  3. SCP/SFTP with libqxt
    By raven-worx in forum Qt Programming
    Replies: 14
    Last Post: 1st June 2012, 13:58
  4. Capable of transferring bitmaps
    By names in forum Qt Programming
    Replies: 0
    Last Post: 21st April 2010, 14:10
  5. Transferring images..
    By xyzt in forum Newbie
    Replies: 1
    Last Post: 10th July 2008, 17:49

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.