本文整理汇总了PHP中FileUploader::getPathToUploadedFile方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUploader::getPathToUploadedFile方法的具体用法?PHP FileUploader::getPathToUploadedFile怎么用?PHP FileUploader::getPathToUploadedFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUploader
的用法示例。
在下文中一共展示了FileUploader::getPathToUploadedFile方法的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: FileUploader
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);
if ($countAr != 3) {
$FlagFileWellFormat = false;
break;
}
if ($userDataAr[0] == null) {