Curl Issue
-
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 ?
-
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
-
@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.
-
@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?
-
@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.
-
Examples here:
https://davidwalsh.name/curl-follow-redirectsCURL -L domain.com
-