本文整理汇总了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';
}