简体   繁体   中英

PHPFlickr photos_getInfo returns Error #1 “Photo not found” after upload

I'm using PHPFlickr's sync_upload method to upload photo to my Flickr photostream. Here's my code so far.

$f = new phpFlickr(xxxyyyzzz, zzzyyyxxx, true);
$f->setToken(aaabbbccc-dddeeefff);
$f->sync_upload($path, "Nondescript description");

$photoID = $f->response; //ID of the uploaded photo
$test = $f->photos_getInfo($photoID);

print_r($test);

After upload, I am able to get the ID of the photo. $f->response would return the ID of the photo.

However, when I use the ID to get the info of the photo I have uploaded, it would return the following error message:

The Flickr API returned the following error: #1 - Photo not found

Is there a way I can get info of the photos I have uploaded immediately after I have uploaded them?

It turns out that:-

$f->sync_upload($path, "Nondescript description");

would yield the photo_id. Which in turn, can be used like this:-

$photo_id = $f->sync_upload($path, "Nondescript description");
$info = $f->photos_getInfo($photo_id);
$size = $f->photos_getSizes($photo_id);

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM