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


PHP FileUploader::uploadFile方法代码示例

本文整理汇总了PHP中FileUploader::uploadFile方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUploader::uploadFile方法的具体用法?PHP FileUploader::uploadFile怎么用?PHP FileUploader::uploadFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileUploader的用法示例。


在下文中一共展示了FileUploader::uploadFile方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: FileUploader

 function upload_file()
 {
     $name = $_FILES['file']['name'];
     $file = $_FILES['file'];
     $fileUploader = new FileUploader($file, $name);
     $json = $fileUploader->uploadFile();
     echo $json;
 }
开发者ID:mawilliamson,项目名称:version-control,代码行数:8,代码来源:VersionPostPage.php

示例2: isset

<?php

include "includes.php";
$id = $_POST['id'];
$filePath = $_POST['filePath'];
$name = isset($_POST['name']) ? $_POST['name'] : null;
$description = isset($_POST['description']) ? $_POST['description'] : null;
$preview = $_POST['preview'];
$thumb = $_POST['thumb'];
$downloads = $_POST['downloads'];
$path;
if (!$id) {
    $file = $_FILES['upload'];
    $fileUploader = new FileUploader($file, $name, $description);
    $id = $fileUploader->uploadFile();
} else {
    $file = new File($filePath, $name, $description, $downloads, $preview, $thumb, $id);
    $file->update();
    header("Location: /admin/files/" . $id);
    exit;
}
开发者ID:mawilliamson,项目名称:wordpress,代码行数:21,代码来源:process_file_form.php

示例3: function

<?php

$this->respond(['GET', 'POST'], '/uploadFile', function ($request, $response, $service, $app) {
    $ans = FileUploader::uploadFile();
    if ($ans != -1) {
        $response->json(Result::success('file uploaded.', ['path' => $ans]));
    } else {
        $response->json(Result::error('file upload Failed.'));
    }
});
开发者ID:AnyApp,项目名称:-Commercial-System,代码行数:10,代码来源:files.php

示例4: uploadFileForUser

 public function uploadFileForUser($file, $id)
 {
     $user = $this->userDao->get($id);
     ResultHelper::whenEmpty($user, AppLabelUtil::$ERROR_USER_NOT_FOUND, HttpStatusCode::badRequest());
     $fileUploader = new FileUploader();
     $newFileName = $fileUploader->uploadFile($file["file"]["name"], $file["file"]["tmp_name"], WEB . "/assets/user/" . $user->getUsername() . "/cv/");
     $user->setFile($newFileName);
     return $this->userDao->update($user);
 }
开发者ID:euBatham,项目名称:javacature,代码行数:9,代码来源:UserService.class.php

示例5: actionSaveShemaObject

 /**
  * Save shema object. All params must be passed vie POST method.
  */
 public function actionSaveShemaObject()
 {
     if (!isset($_POST['shema'])) {
         die('Invalid shema');
     }
     //TODO
     $attr = $_POST;
     $type = $attr['shema'];
     if (FileUploader::hasFile('xfile')) {
         $attr['text_value'] = FileUploader::uploadFile('xfile');
     }
     $object = DataModelFactory::createDataObjectWithType($type);
     $object->setAttributes($attr);
     $storage = DataStorageFactory::createDataStorageWithType($type);
     $storage->save($object);
     $this->redirect(Yii::app()->createUrl('manager/shema', array('shema' => $type)));
 }
开发者ID:rosko,项目名称:AlmazService,代码行数:20,代码来源:ManagerController.php

示例6: FileUploader

<?php

include "../../../wp-load.php";
$name = $_FILES['file']['name'];
$file = $_FILES['file'];
$fileUploader = new FileUploader($file, $name);
$json = $fileUploader->uploadFile();
echo $json;
开发者ID:mawilliamson,项目名称:version-control,代码行数:8,代码来源:upload_file.php


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