当前位置: 首页>>代码示例>>PHP>>正文


PHP FileSystem::uploadFile方法代码示例

本文整理汇总了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;
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:13,代码来源:VideosPlugin.php

示例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";
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:30,代码来源:upload_video.php

示例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);
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:4,代码来源:shortcuts.php


注:本文中的FileSystem::uploadFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。