本文整理匯總了PHP中phpFlickr::async_upload方法的典型用法代碼示例。如果您正苦於以下問題:PHP phpFlickr::async_upload方法的具體用法?PHP phpFlickr::async_upload怎麽用?PHP phpFlickr::async_upload使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類phpFlickr
的用法示例。
在下文中一共展示了phpFlickr::async_upload方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: uploadPhoto
function uploadPhoto($path, $title)
{
$apiKey = "3b7d4ab3e54988c4e6fd59d9e40ca28c";
$apiSecret = "84d2e480c8e3c926";
$permissions = "write";
$token = "72157626228984291-4635fa88a6fed8f5";
$f = new phpFlickr($apiKey, $apiSecret, true);
$f->setToken($token);
return $f->async_upload($path, $title);
}
示例2: upload_photo
function upload_photo($path, $title)
{
$apiKey = "your-flickr-key";
$apiSecret = "your-flickr-secret";
$token = "flickr-token";
$permissions = "write";
$f = new phpFlickr($apiKey, $apiSecret, true);
$f->setToken($token);
$f->async_upload($path, $title);
@unlink("temp.jpg");
}
示例3: uploadPhoto
function uploadPhoto($fileID, $title = "", $description = "", $tag = "")
{
$flickr = new phpFlickr($this->getAPIKey(), $this->getAPISecret());
$flickr->setToken($this->getAPIToken());
if ($file = DataObject::get_by_id("File", $fileID)) {
$flickr->async_upload($file->getFullPath(), $title, $description, $tag);
return true;
} else {
return false;
}
}
示例4: phpFlickr
<?php
require_once 'base_dato.php';
require_once "phpFlickr.php";
$f = new phpFlickr("<api key>");
// CAMBIOS A DIST
//$bd = new MysqliDb('localhost', 'josuelopez27_par', '23503360', 'josuelopez27_par');
//$connect = mysqli_connect("localhost","josuelopez27_par","23503360");
// CAMBIOS A PRUEBA
$bd = new MysqliDb('localhost', 'root', '', 'CATALOGO_PRUEBA');
$connect = mysqli_connect("localhost", "root", "");
if (!empty($_FILES)) {
$tempPath = $_FILES['file']['tmp_name'];
$uploadPath = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . $_FILES['file']['name'];
move_uploaded_file($tempPath, $uploadPath);
$apiKey = "5f1ba3cb88d4ed7b109be31f9fb928a4";
$apiSecret = "13ce4def3dfd80d5";
$permissions = "write";
$token = "__your__generated__token__";
$f = new phpFlickr($apiKey, $apiSecret, true);
$f->setToken($token);
return $f->async_upload($path, $title);
$answer = array('answer' => 'File transfer completed');
$json = json_encode($answer);
echo $json;
} else {
echo 'No files';
}