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


PHP qqFileUploader::getFileType方法代码示例

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


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

示例1: convertStringToArray

        $phpwcms['file_maxsize'] = $upload_max_filesize - 1;
    }
} else {
    $upload_max_filesize = $phpwcms['file_maxsize'];
}
if (is_string($phpwcms['allowed_upload_ext'])) {
    $phpwcms['allowed_upload_ext'] = convertStringToArray(strtolower($phpwcms['allowed_upload_ext']));
}
$uploader = new qqFileUploader($phpwcms['allowed_upload_ext'], min($post_max_size, $upload_max_filesize, $phpwcms['file_maxsize']));
$uploadDir = PHPWCMS_ROOT . $phpwcms["ftp_path"];
// Call handleUpload() with the name of the folder, relative to PHP's getcwd()
$result = $uploader->handleUpload($uploadDir, NULL, TRUE, FALSE);
$result['filename'] = $uploader->getUploadName();
if (!empty($result['success']) && !empty($_GET['file_public'])) {
    require_once PHPWCMS_ROOT . '/include/inc_lib/dbcon.inc.php';
    $data = array('f_pid' => intval($_GET['file_dir']), 'f_uid' => intval($_SESSION["wcs_user_id"]), 'f_kid' => 1, 'f_aktiv' => 1, 'f_public' => 1, 'f_name' => $result['filename'], 'f_created' => now(), 'f_size' => $uploader->getFileSize(), 'f_type' => $uploader->getFileType(), 'f_ext' => strtolower($uploader->getFileExtension()), 'f_longinfo' => slweg($_GET['file_longinfo']), 'f_hash' => md5($result['filename'] . microtime()), 'f_copyright' => slweg($_GET['file_copyright']), 'f_tags' => clean_slweg($_GET['file_tags']));
    if (PHPWCMS_CHARSET != 'utf-8') {
        $data['f_name'] = makeCharsetConversion($data['f_name'], 'utf-8', PHPWCMS_CHARSET);
        $data['f_longinfo'] = makeCharsetConversion($data['f_longinfo'], 'utf-8', PHPWCMS_CHARSET);
        $data['f_copyright'] = makeCharsetConversion($data['f_copyright'], 'utf-8', PHPWCMS_CHARSET);
        $data['f_tags'] = makeCharsetConversion($data['f_tags'], 'utf-8', PHPWCMS_CHARSET);
    }
    $insert = _dbInsert('phpwcms_file', $data);
    // move uploaded file
    if (!empty($insert['INSERT_ID'])) {
        $userftppath = PHPWCMS_ROOT . $phpwcms["ftp_path"];
        $useruploadpath = PHPWCMS_ROOT . $phpwcms["file_path"];
        $usernewfile = $useruploadpath . $data['f_hash'];
        if ($data['f_ext']) {
            $usernewfile .= '.' . $data['f_ext'];
        }
开发者ID:Ideenkarosell,项目名称:phpwcms,代码行数:31,代码来源:act_upload.php


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