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