當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。