ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Curl Issue

    IT Discussion
    curl
    4
    7
    1.5k
    Loading More Posts
    • 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.
    • LakshmanaL
      Lakshmana
      last edited by scottalanmiller

      The file which I am trying to download through Curl downloads but the file is downloaded but it opens as the html file and gives the information the 302 Found the file moved here. While clicking on here the file is downloaded now. As checked in the internet i found this as a Solution how to do this ?

      Need to write .sh file for that or its a PHP file ?

      https://curl.haxx.se/mail/curlphp-2004-12/0011.html

      https://www.sitepoint.com/community/t/reading-url-with-curl-library-getting-error-302-moved-temporarily/1969

      1 Reply Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller
        last edited by

        This means that the link that you have is bad, but they are redirecting you, potentially, to a good one. cURL, by default, does not follow redirection. But there is a setting to enable that.

        Set: CURLOPT_FOLLOWLOCATION to 1

        LakshmanaL 1 Reply Last reply Reply Quote 1
        • stacksofplatesS
          stacksofplates
          last edited by

          @scottalanmiller said in Curl Issue:

          This means that the link that you have is bad, but they are redirecting you, potentially, to a good one. cURL, by default, does not follow redirection. But there is a setting to enable that.

          Set: CURLOPT_FOLLOWLOCATION to 1

          You can just use -L to follow redirects.

          1 Reply Last reply Reply Quote 3
          • LakshmanaL
            Lakshmana @scottalanmiller
            last edited by

            @scottalanmiller said in Curl Issue:

            This means that the link that you have is bad, but they are redirecting you, potentially, to a good one. cURL, by default, does not follow redirection. But there is a setting to enable that.

            Set: CURLOPT_FOLLOWLOCATION to 1

            Can I know the location?

            scottalanmillerS 1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller @Lakshmana
              last edited by

              @lakshmana said in Curl Issue:

              @scottalanmiller said in Curl Issue:

              This means that the link that you have is bad, but they are redirecting you, potentially, to a good one. cURL, by default, does not follow redirection. But there is a setting to enable that.

              Set: CURLOPT_FOLLOWLOCATION to 1

              Can I know the location?

              Just use the -L option.

              1 Reply Last reply Reply Quote 0
              • dbeatoD
                dbeato
                last edited by

                Examples here:
                https://davidwalsh.name/curl-follow-redirects

                CURL -L domain.com

                1 Reply Last reply Reply Quote 0
                • LakshmanaL
                  Lakshmana
                  last edited by

                  The same issue Happened while using

                  Curl -L URL.com

                  Because of that I am going for Remote login

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post