使用phpSmug上传后获得smugmug唯一的照片密钥


Getting smugmug unique photo key after upload using phpSmug

我正在使用phpSmug上传图像到smugmug,代码工作,但我没有得到任何响应。我需要一些如何得到唯一的钥匙smugmug分配给照片后上传它。这是我正在使用的工作代码:

require_once( "phpSmug.php" );
try {
$f = new phpSmug( "APIKey=xxxxxxxxxxxxxx", "AppName=xxxxxxxxxxxx" );
// Login With EmailAddress and Password
$f->login( "EmailAddress=xxxxx@xxxx.com", "Password=xxxxx" );   
$f->images_upload("AlbumID=xxxxxxxx", "File=TestImage.jpg");

}
catch ( Exception $e ) {
    echo "{$e->getMessage()} (Error Code: {$e->getCode()})";
}

明白了。而不是:

$f->images_upload("AlbumID=xxxxxxxx", "File=TestImage.jpg");

返回响应,所以我可以用this代替:

$response = $f->images_upload("AlbumID=xxxxxxxx", "File=TestImage.jpg");
echo "ID: $response[id]<BR>Key: $response[Key]<BR>URL: $response[URL]";

然后返回一个数组包含id, key和url

我希望这能帮助到别人。