本文整理汇总了PHP中Actions::uploadFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Actions::uploadFile方法的具体用法?PHP Actions::uploadFile怎么用?PHP Actions::uploadFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Actions
的用法示例。
在下文中一共展示了Actions::uploadFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uploadMulti
/**
* prepare multiple files for upload
*
* @param array $coda $_FLES['userfile']
*
* @return call uploadFIle()
*/
public function uploadMulti($coda)
{
global $location;
if ($location->editAllowed() && GateKeeper::isUserLoggedIn() && GateKeeper::isAccessAllowed() && GateKeeper::isAllowed('upload_enable')) {
// Number of files to uploaded
$num_files = count($coda['tmp_name']);
$totnames = array();
/** loop through the array of files ***/
for ($i = 0; $i < $num_files; $i++) {
$filepathinfo = Utils::mbPathinfo($coda['name'][$i]);
$filename = $filepathinfo['filename'];
$filex = $filepathinfo['extension'];
$thename = $filepathinfo['basename'];
$tempname = $coda['tmp_name'][$i];
$tipo = $coda['type'][$i];
$filerror = $coda['error'][$i];
if (in_array($thename, $totnames)) {
$thename = $filename . $i . "." . $filex;
}
if (Utils::notList($thename, array('.htaccess', '.htpasswd', '.ftpquota')) == true) {
array_push($totnames, $thename);
if ($thename) {
Actions::uploadFile($location, $thename, $tempname, $tipo);
// check uplad errors
FileManager::upLog($filerror);
}
}
}
}
}