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

    Curl Issue

    IT Discussion
    curl
    4
    7
    1230
    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.
    • Lakshmana
      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
      • scottalanmiller
        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

        Lakshmana 1 Reply Last reply Reply Quote 1
        • stacksofplates
          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
          • Lakshmana
            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?

            scottalanmiller 1 Reply Last reply Reply Quote 0
            • scottalanmiller
              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
              • dbeato
                dbeato last edited by

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

                CURL -L domain.com

                1 Reply Last reply Reply Quote 0
                • Lakshmana
                  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
                  • First post
                    Last post