1

I am trying to upload a video to my Flickr account using PHP. The PHP script is running on my localhost server.

I have downloaded a .php library to assist me

https://github.com/dan-coulter/phpflickr

I have created a Flickr account and created an 'app' I have my api key and secret key. I have set my app as a "web application" and set my callback to 127.0.0.1:80 This has worked on several other file sharing hosts, so I thought it may work on Flickr

Here is my code

function uploadFlickr( $fileToSave , $fileName , $fileDesc , $fileTags ) {

require_once 'flickr/phpFlickr.php';

$consumer_key = "key";
$consumer_secret = "secretkey";

$flickr = new phpFlickr($consumer_key,$consumer_secret, true);

if(empty($_GET['frob'])) {
    $flickr->auth('write');
}
else {
    $flickr->auth_getToken($_GET['frob']);
}

$resu = $flickr->sync_upload( $fileToSave , $fileName , $fileDesc , $fileTags );

echo "<pre>"; print_r($resu);
}

So firstly, the example script provided in the gitHub library doesn't seem to like the callback url. I get the auth request path, I hit accept and then it kicks me to an error page.

 Oops! Looks like you followed a bad link. 

No other error info.

Also, Most other file sharing hosts allow a direct authentication by passing a username and password so I can upload directly to my own account.

My app will not work if I have to manually accept uploads to my own account. It needs to be automated.

Is this possible with Flickr using PHP?

Any help would be great, thanks.

nomaam
  • 1,213
  • 2
  • 22
  • 37

0 Answers0