本文整理汇总了PHP中FileSystem::uploadFile方法的典型用法代码示例。如果您正苦于以下问题:PHP FileSystem::uploadFile方法的具体用法?PHP FileSystem::uploadFile怎么用?PHP FileSystem::uploadFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSystem
的用法示例。
在下文中一共展示了FileSystem::uploadFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processUploadedVideo
/**
* @param string $filename
* @param Video $container
*/
static function processUploadedVideo($filename, $container)
{
$file = new File();
$file->access_id = $container->access_id;
$file->container_guid = $container->guid;
$file_guid = $file->save();
FileSystem::uploadFile($filename, $file_guid, array("mov", "mpeg4", "mp4", "avi", "wmv", "mpegps", "flv", "3gpp", "webm", "3gp", "3g2", "m4v", "m2v", "mkv"));
return $file_guid;
}
示例2: header
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
exit;
}
include_once dirname(dirname(__FILE__)) . "/engine/start.php";
$key = getInput("key");
if ($key == SITESECRET) {
$owner_guid = getInput("owner_guid");
$container_guid = getInput("container_guid");
$video = new Video();
$video->video_type = "upload";
// $video->title = $title;
// $video->description = $description;
$video->owner_guid = $owner_guid;
$video->access_id = "public";
$video->container_guid = $container_guid;
$video->save();
$file = new File();
$file->access_id = "public";
$file->container_guid = $video->guid;
$file_guid = $file->save();
FileSystem::uploadFile("video", $file_guid, array("mov", "mpeg4", "mp4", "avi", "wmv", "mpegps", "flv", "3gpp", "webm", "3gp", "3g2", "m4v", "m2v", "mkv"));
$video->video_guid = $file_guid;
$video->save();
$video->createAvatar();
$video->save();
} else {
echo "bad key";
}
示例3: uploadFile
function uploadFile($filename, $file_guid, $allowed_extensions = array("png", "jpg", "jpeg", "gif", "doc", "docx", "ods"))
{
return FileSystem::uploadFile($filename, $file_guid, $allowed_extensions);
}