Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. Ftp user details fetching
Forum Updated to NodeBB v4.3 + New Features

Ftp user details fetching

Scheduled Pinned Locked Moved Qt WebKit
8 Posts 3 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bhupi123
    wrote on last edited by
    #1

    I am implementing ftp file transfer in my app. In my app i have to add functionality to get user details and store them in a file I am able to get file uploaded to filezilla but not able to get user details like username password.

    void example::replyFinished(QNetworkReply *rep1){
    QNetworkReply::NetworkError error = rep1->error();
    if (error == QNetworkReply::NoError) {

    QByteArray bts = rep1->readAll();
    

    }

    In this slot readAll is returning empty. So is their any method of any way of getting user details in app from server I searched on net but not get any solution yet.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      What do you mean by the user details ? Where from ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bhupi123
        wrote on last edited by
        #3

        thanks for replying

        From user details I mean username ,password etc
        and from ftp(file transfer protocol) from server

        If i am making connection using QNetworkAccessManager and bye providing http://(domain) then this code

        void example::replyFinished(QNetworkReply *rep1){
        QNetworkReply::NetworkError error = rep1->error();
        if (error == QNetworkReply::NoError) {
        QByteArray bts = rep1->readAll(); }

        returning these userdetails in variable "bts" .

        but if i use ftp:// (domain) then this code returning nothing after successfully connecting to server currently in case of ftp i am using filezilla as server

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          It's still not clear. Do you want to ask the user of your program to provide the username and password ? Or should it be downloaded from the ftp ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bhupi123
            wrote on last edited by
            #5

            it should be downloaded from ftp

            in the code slot void example::replyFinished(QNetworkReply rep1) is called when connection emits finished(QNetworkReply) signal then if must return these details in variable bts is it possible in case of ftp.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              So you have a plain text file on your ftp containing username/password combinations that you want to download ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • T Offline
                T Offline
                ThatDude
                wrote on last edited by
                #7

                Are you sure that you provide the correct file name when you use ftp protocol?

                When you use http protocol without specifying a file you actually download the default file - actual file name depends on web-server's settings but usually is default.htm or index.htm or *.html
                That is not the case with ftp though - there is no default file to download
                e.g.
                http://www.example.com/
                could actually serve you s.th. like
                http://www.example.com/index.html
                or
                http://www.example.com/default.html
                while
                ftp://ftp.example.com/
                will serve you nothing - you'll only connect to that server and it will wait for your commands (LIST, GET, PUT etc.)
                so you'll have to specify actual file name
                ftp://ftp.example.com/index.html
                or (as usually is the case with web server residing on different path)
                it is more likely to be
                ftp://ftp.example.com/www/inetpub/thatcorp/that_website/index.htm

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  bhupi123
                  wrote on last edited by
                  #8

                  I got it solved

                  thanks guys

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved