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


PHP FileUpload::getMessage方法代码示例

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


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

示例1: editorupload

 public function editorupload()
 {
     $CRUD_AUTH = $this->session->userdata('CRUD_AUTH');
     if (empty($CRUD_AUTH)) {
         exit;
     }
     if (isset($_GET['CKEditorFuncNum'])) {
         require FCPATH . '/application/third_party/scrud/class/FileUpload.php';
         $msg = '';
         // Will be returned empty if no problems
         $callback = $_GET['CKEditorFuncNum'];
         // Tells CKeditor which function you are executing
         $fileUpload = new FileUpload();
         $fileUpload->uploadDir = __IMAGE_UPLOAD_REAL_PATH__;
         $fileUpload->extensions = array('.bmp', '.jpeg', '.jpg', '.png', '.gif');
         $fileUpload->tmpFileName = $_FILES['upload']['tmp_name'];
         $fileUpload->fileName = $_FILES['upload']['name'];
         $fileUpload->httpError = $_FILES['upload']['error'];
         if ($fileUpload->upload()) {
             $image_url = __MEDIA_PATH__ . "images/" . $fileUpload->newFileName;
         }
         $error = $fileUpload->getMessage();
         if (!empty($error)) {
             $msg = 'error : ' . implode("\n", $error);
         }
         $output = '<script type="text/javascript">window.parent.CKEDITOR.tools.callFunction(' . $callback . ', "' . $image_url . '","' . $msg . '");</script>';
         echo $output;
     }
 }
开发者ID:Dannyngs,项目名称:kim_hung_aquarium,代码行数:29,代码来源:scrud.php

示例2: responeJson

<?php

require 'FileUpload.php';
function responeJson($obj)
{
    header('Content-Type: application/json');
    echo json_encode($obj);
}
$path = 'img/users/';
$fileuploader = new FileUpload('../' . $path);
$fileuploader->image('fileUpload');
// print_r($fileuploader->getInfo());
// print_r($fileuploader->getMessage());
$result = array('fileInfo' => $fileuploader->getInfo(), 'errorMessage' => $fileuploader->getMessage(), 'filepath' => $path . $fileuploader->getInfo()['name']);
return responeJson($result);
开发者ID:borachann,项目名称:MoneyManagement,代码行数:15,代码来源:fileuploaded.php


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