phpflickr icon indicating copy to clipboard operation
phpflickr copied to clipboard

replace method doesn't use replace url

Open tacman opened this issue 1 year ago • 2 comments

 $flickr->uploader()->replace('/path/to/photo.jpg', 44333812150);

Should probably go to

/** @var string */
protected $replaceEndpoint = 'https://up.flickr.com/services/replace/';

Instead, it goes to the upload endpoint

/** @var string */
protected $uploadEndpoint = 'https://up.flickr.com/services/upload/';

I think the easiest solution is to add the endpoint to the sendFile call, or to pass a boolean $replace and select the endpoint in sendFile()

    public function replace($photoFilename, $photoId, $async = null)
    {
        return $this->sendFile($photoFilename, ['photo_id' => $photoId, 'async' => $async]);
    }

WDYT?

tacman avatar Jul 22 '24 12:07 tacman

I think passing $replace to sendFile() sounds sensible. That endpoint isn't needed for anything else is it?

samwilson avatar Nov 21 '24 23:11 samwilson

no, i haven't seen it in use elsewhere.

tacman avatar Nov 21 '24 23:11 tacman