本文整理汇总了PHP中FileUploader::getErrorMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUploader::getErrorMessage方法的具体用法?PHP FileUploader::getErrorMessage怎么用?PHP FileUploader::getErrorMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUploader
的用法示例。
在下文中一共展示了FileUploader::getErrorMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: realpath
/**
* Base config file
*/
require_once realpath(dirname(__FILE__)) . '/../../config_path.inc.php';
/**
* Clear node and layout variable in $_SESSION
*/
$variableToClearAR = array('node', 'layout', 'course', 'user');
/**
* Users (types) allowed to access this module.
*/
$allowedUsersAr = array(AMA_TYPE_SWITCHER);
/**
* Get needed objects
*/
$neededObjAr = array(AMA_TYPE_SWITCHER => array('layout'));
/**
* Performs basic controls before entering this module
*/
require_once ROOT_DIR . '/include/module_init.inc.php';
require_once ROOT_DIR . '/browsing/include/browsing_functions.inc.php';
require_once ROOT_DIR . '/include/FileUploader.inc.php';
$fileUploader = new FileUploader(ADA_UPLOAD_PATH);
if ($fileUploader->upload() == false) {
$data = $fileUploader->getErrorMessage();
} else {
$_SESSION['importHelper']['filename'] = $fileUploader->getPathToUploadedFile();
$data = '1';
// '1' means okay
}
echo $data;
示例2: array
$neededObjAr = array(AMA_TYPE_SWITCHER => array('layout', 'user', 'course', 'course_instance'));
require_once ROOT_DIR . '/include/module_init.inc.php';
$self = whoami();
require_once 'include/switcher_functions.inc.php';
require_once 'include/Subscription.inc.php';
include_once ROOT_DIR . '/include/token_classes.inc.php';
require_once ROOT_DIR . '/include/FileUploader.inc.php';
require_once ROOT_DIR . '/include/Forms/FileUploadForm.inc.php';
/*
* YOUR CODE HERE
*/
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
// $fileUploader = new FileUploader(ROOT_DIR . '/upload_file/uploaded_files/switcher/' . $userObj->getId().'/');
$fileUploader = new FileUploader(ADA_UPLOAD_PATH . $userObj->getId() . '/');
if ($fileUploader->upload() == false) {
$data = new CText($fileUploader->getErrorMessage());
} else {
$courseId = $_POST['id_course'];
$courseInstanceId = $_POST['id_course_instance'];
$FlagFileWellFormat = true;
if (is_readable($fileUploader->getPathToUploadedFile())) {
$usersToSubscribe = file($fileUploader->getPathToUploadedFile());
/*remove blanck line form array*/
foreach ($usersToSubscribe as $key => $value) {
if (!trim($value)) {
unset($usersToSubscribe[$key]);
}
}
foreach ($usersToSubscribe as $subscriber) {
$userDataAr = explode(',', $subscriber);
$countAr = count($userDataAr);