So, I have an Amazon S3 encoded URL that I want to download. If I pass the URL along without quotes, I get a 403 Forbidden response from S3.
curl -O https://zencoder-temp-storage-us-east-1.s3.amazonaws.com/t/20141008/413f96bd17a210c0cfe2997d83a4782c/Nerve_Flossing_Highly_Irratible_Radial_Nerve_Wartenburgs_Syndrome-thumb.jpg?AWSAccessKeyId=AKIAI456JQ76GBU7FECA&Signature=Sd18YXJIMvLqeRFZYCzDNYdpg7U%3D&Expires=1412866120
But, just wrapping it in quotes, works great from the command line:
curl -O "https://zencoder-temp-storage-us-east-1.s3.amazonaws.com/t/20141008/413f96bd17a210c0cfe2997d83a4782c/Nerve_Flossing_Highly_Irratible_Radial_Nerve_Wartenburgs_Syndrome-thumb.jpg?AWSAccessKeyId=AKIAI456JQ76GBU7FECA&Signature=Sd18YXJIMvLqeRFZYCzDNYdpg7U%3D&Expires=1412866120"
But... when I try to implement this in PHP, I end up saving a file with 0 bytes.
$curl = curl_init("'".$url."'");
$fp = fopen($filepath, "w");
curl_setopt($curl, CURLOPT_FILE, $fp);
curl_exec ($curl);
curl_close ($curl);
fclose($fp);
Is there a way to do this with PHP that I'm missing?
EDIT: to provide the actual S3 url for easier testing.