當前位置: 首頁>>代碼示例>>PHP>>正文


PHP fileupload::fileupload方法代碼示例

本文整理匯總了PHP中fileupload::fileupload方法的典型用法代碼示例。如果您正苦於以下問題:PHP fileupload::fileupload方法的具體用法?PHP fileupload::fileupload怎麽用?PHP fileupload::fileupload使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在fileupload的用法示例。


在下文中一共展示了fileupload::fileupload方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

 $allowed_extensions = array();
 if (phpbb_gallery_config::get('allow_jpg')) {
     $allowed_extensions[] = 'jpg';
     $allowed_extensions[] = 'jpeg';
 }
 if (phpbb_gallery_config::get('allow_gif')) {
     $allowed_extensions[] = 'gif';
 }
 if (phpbb_gallery_config::get('allow_png')) {
     $allowed_extensions[] = 'png';
 }
 if (!class_exists('fileupload')) {
     phpbb_gallery_url::_include('functions_upload', 'phpbb');
 }
 $fileupload = new fileupload();
 $fileupload->fileupload('', $allowed_extensions, 4 * phpbb_gallery_config::get('max_filesize'));
 $upload_image_files = phpbb_gallery::$auth->acl_check('i_unlimited', $album_id, $album_data['album_user_id']) ? phpbb_gallery_config::get('num_uploads') : min(phpbb_gallery::$auth->acl_check('i_count', $album_id, $album_data['album_user_id']) - $own_images, phpbb_gallery_config::get('num_uploads'));
 // Get File Upload Info
 $image_id_ary = array();
 $loop = request_var('image_num', 0);
 $rotate = request_var('rotate', array(0));
 $loop = $loop != 0 ? $loop - 1 : $loop;
 for ($i = 0; $i < $upload_image_files; $i++) {
     $image_file = $fileupload->form_upload('image_file_' . $i);
     if (!$image_file->uploadname) {
         continue;
     }
     $image_file->clean_filename('unique_ext');
     $image_file->move_file(substr(phpbb_gallery_url::path('upload_noroot'), 0, -1), false, false, CHMOD_ALL);
     if (sizeof($image_file->error) && $image_file->uploadname) {
         $image_file->remove();
開發者ID:phpbbgallery,項目名稱:phpbb-gallery,代碼行數:31,代碼來源:posting.php


注:本文中的fileupload::fileupload方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。