Skip to content

Instantly share code, notes, and snippets.

@danielmurphy
Last active August 29, 2015 13:56
Show Gist options
  • Save danielmurphy/9099540 to your computer and use it in GitHub Desktop.
Save danielmurphy/9099540 to your computer and use it in GitHub Desktop.
Use OAuth to download an image attachment.
<?php
$oauth = new OAuth($consumer_key, $consumer_secret);
$oauth->setToken($access_token, $access_token_secret);
$oauth->disableRedirects();
$oauth->fetch('https://planningcenteronline.com/attachments/23128559');
$response_info = $oauth->getLastResponseInfo();
copy($response_info['redirect_url'], './file.jpg');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment