tags:

views:

14

answers:

0

I'm using PHP Oauth PECL Library to access audio files on Soundcloud and I'm not sure of the best way to do this.

What I have so far is:

$oauth = new OAuth(
    $network->get_consumer_key(),
    $network->get_consumer_secret(),
    OAUTH_SIG_METHOD_HMACSHA1,
    OAUTH_AUTH_TYPE_URI
);

$oauth->setToken('', '');
$oauth->fetch('', array(), OAUTH_HTTP_METHOD_GET, array("User-Agent" => "pecl/oauth"));

This will load all the data for the audio file into:

$oauth->body_recv

... which is not what I want. I'd like to transfer the file via FTP to another location as it's being read, without having to load the whole thing into memory before I can do anything with it.

I can't find a way to just access the URI that the fetch method is going to call without actually calling the method. If I could access that URI then I could at least use fopen() or something.

Is there any way to accomplish this?