Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Upload file to server via https
Forum Update on Monday, May 27th 2025

Upload file to server via https

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 5 Posters 750 Views
  • 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.
  • X Offline
    X Offline
    xbasista
    wrote on last edited by
    #2
    This post is deleted!
    1 Reply Last reply
    0
    • X xbasista

      Hello,

      i'm new in QT and i do not know how to send file to server. I have url like:
      "https://www.example.com/?import=data=&DATA&",
      where &DATA& is that file.

      i need something like:

      request("https://www.example.com/?import=data=&DATA&");
      
      respond = respond();
      qDebug << respond;
      

      Is is possible?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #3

      @xbasista
      From that URL I don't think it takes a file to upload. Rather I suspect you have to supply the data/content of the file where shown on the URL?

      You can use QNetworkReply *QNetworkAccessManager::get(const QNetworkRequest &request) to make the URL request you show.

      1 Reply Last reply
      3
      • X xbasista

        Hello,

        i'm new in QT and i do not know how to send file to server. I have url like:
        "https://www.example.com/?import=data=&DATA&",
        where &DATA& is that file.

        i need something like:

        request("https://www.example.com/?import=data=&DATA&");
        
        respond = respond();
        qDebug << respond;
        

        Is is possible?

        artwawA Offline
        artwawA Offline
        artwaw
        wrote on last edited by
        #4

        @xbasista
        https://doc.qt.io/qt-5/qnetworkaccessmanager.html

        https://doc.qt.io/qt-5/qnetworkrequest.html

        https://doc.qt.io/qt-5/qnetworkreply.html

        For more information please re-read.

        Kind Regards,
        Artur

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

          Hi and welcome to devnet,

          Beside the good points of my fellow, depending on your OS ensure that you have OpenSSL available as well.

          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
          • X Offline
            X Offline
            xbasista
            wrote on last edited by xbasista
            #6

            Thanks,

            @JonB you were right. I made simple http request as you wrote. It is working perfectly but when I put that application on another pc I get empty response (response = ""). It looks like application do not comunication to server. I tried add exception to windows firewall, turn off ativirus but it still not working.

            Does anyone know where the problem might be?

            jsulmJ JonBJ 2 Replies Last reply
            0
            • X xbasista

              Thanks,

              @JonB you were right. I made simple http request as you wrote. It is working perfectly but when I put that application on another pc I get empty response (response = ""). It looks like application do not comunication to server. I tried add exception to windows firewall, turn off ativirus but it still not working.

              Does anyone know where the problem might be?

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #7

              @xbasista said in Upload file to server via https:

              Does anyone know where the problem might be?

              You should add error handling to your code to see what happens.
              https://doc.qt.io/qt-5/qnetworkreply.html#errorOccurred

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • X xbasista

                Thanks,

                @JonB you were right. I made simple http request as you wrote. It is working perfectly but when I put that application on another pc I get empty response (response = ""). It looks like application do not comunication to server. I tried add exception to windows firewall, turn off ativirus but it still not working.

                Does anyone know where the problem might be?

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by JonB
                #8

                @xbasista
                As Per @jsulm, you should always add error handling to your code. Since you are trying to access an https, at a guess you do not have the necessary Qt OpenSSL requirements on one machine.

                jsulmJ 1 Reply Last reply
                2
                • JonBJ JonB

                  @xbasista
                  As Per @jsulm, you should always add error handling to your code. Since you are trying to access an https, at a guess you do not have the necessary Qt OpenSSL requirements on one machine.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  @JonB @xbasista https://doc.qt.io/qt-5/qnetworkaccessmanager.html#sslErrors

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  2
                  • X Offline
                    X Offline
                    xbasista
                    wrote on last edited by
                    #10

                    @jsulm
                    I added to my code and i found out that on another pc is not openssl support [ QSslSocket::supportsSsl() ].
                    I read that https://stackoverflow.com/questions/20351155/how-can-i-enable-ssl-in-qt-windows-application and i think i need libeay32.dll and ssleay32.dll libs. The problem is i do not know where can i found that files? They shloud be in openSSL folder/bin but i don't have that folder.

                    Output on build pc:

                    SslSupport:  true
                    SslLibraryBuildVersion:  "OpenSSL 1.1.1g  21 Apr 2020"
                    SslLibraryRuntimeVersion:  "OpenSSL 1.1.1k  25 Mar 2021"
                    

                    Output on another pc:

                    SslSupport:  
                    SslLibraryBuildVersion:  "OpenSSL 1.1.1g  21 Apr 2020"
                    SslLibraryRuntimeVersion:  
                    
                    1 Reply Last reply
                    0
                    • X Offline
                      X Offline
                      xbasista
                      wrote on last edited by xbasista
                      #11

                      I found out that:

                      "
                      For ssl 1.0.x (qt<5.12.4) you are likely missing libeay32.dll and ssleay32.dll.

                      For ssl 1.1.x (qt>=5.12.4) binary compatibility broke (qt 5.12.4 released), so you might need libssl-1_1.dll and libcrypto-1_1.dll, and its dependencies capi.dll and dasync.dll.
                      "

                      So i import libssl-1_1-x64.dll and libcrypto-1_1-x64.dll from my openssl and everything working.

                      Thanks

                      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