javascript - Responsive FileManager with tinyMCE upload error -
i'm using tinymce 4 wysiwyg editor , i've installed responsive filemanager in asp.net environment. tutorial have problem when using simple upload file ( > 1.5mb ), nothing uploaded server (every thing ok when upload smaller file: test 1.2mb & 0.8mb of pdf file.
please me, stuck on 2 days :( below config.php file (max file size upload: 100mb )
<?php session_start(); mb_internal_encoding('utf-8'); date_default_timezone_set('europe/rome'); /* |-------------------------------------------------------------------------- | optional security |-------------------------------------------------------------------------- | | if set true access rf url contains access key(akey) like: | <input type="button" href="../filemanager/dialog.php?field_id=imgfield&lang=en_en&akey=myprivatekey" value="files"> | in tinymce new parameter added: filemanager_access_key:"myprivatekey" | example tinymce config: | | tiny init ... | external_filemanager_path:"../filemanager/", | filemanager_title:"filemanager" , | filemanager_access_key:"myprivatekey" , | ... | */ define('use_access_keys', false); // true or false /* |-------------------------------------------------------------------------- | don't copy variables in folders config.php files |-------------------------------------------------------------------------- */ /* |-------------------------------------------------------------------------- | path configuration |-------------------------------------------------------------------------- | in configuration folder tree | root | |- source <- upload folder | |- thumbs <- thumbnail folder [must have write permission (755)] | |- filemanager | |- js | | |- tinymce | | | |- plugins | | | | |- responsivefilemanager | | | | | |- plugin.min.js */ $config = array( /* |-------------------------------------------------------------------------- | don't touch (base url (only domain) of site). |-------------------------------------------------------------------------- | | without final / | */ 'base_url' => ((isset($_server['https']) && $_server['https'] && ! in_array(strtolower($_server['https']), array( 'off', 'no' ))) ? 'https' : 'http') . '://' . $_server['http_host'], /* |-------------------------------------------------------------------------- | path base_url base of upload folder |-------------------------------------------------------------------------- | | start , final / | */ 'upload_dir' => '/source/', /* |-------------------------------------------------------------------------- | relative path filemanager folder upload folder |-------------------------------------------------------------------------- | | final / | */ 'current_path' => '../source/', /* |-------------------------------------------------------------------------- | relative path filemanager folder thumbs folder |-------------------------------------------------------------------------- | | final / | not put inside upload folder | */ 'thumbs_base_path' => '../thumbs/', /* |-------------------------------------------------------------------------- | access keys |-------------------------------------------------------------------------- | | add access keys eg: array('myprivatekey', 'someoneelsekey'); | keys should containt (a-z a-z 0-9 \ . _ -) characters | if integrating lets cms admins, recommend making keys randomized this: | $username = 'admin'; | $salt = 'dsflfwr9u2xqa' (a hard coded string) | $akey = md5($username.$salt); | not use 'key' access key! | keys case sensitive! | */ 'access_keys' => array(), //-------------------------------------------------------------------------------------------------------- // can copy , change these variables folders config.php files customize each folder options //-------------------------------------------------------------------------------------------------------- /* |-------------------------------------------------------------------------- | maximum upload size |-------------------------------------------------------------------------- | | in megabytes | */ 'maxsizeupload' => 100, /* |-------------------------------------------------------------------------- | default language file name |-------------------------------------------------------------------------- */ 'default_language' => "vi", /* |-------------------------------------------------------------------------- | icon theme |-------------------------------------------------------------------------- | | default available: ico , ico_dark | can set custom icon inside filemanager/img | */ 'icon_theme' => "ico", //show or not show folder size in list view feature in filemanager (is possible, if there large folder, increase calculations) 'show_folder_size' => true, //show or not show sorting feature in filemanager 'show_sorting_bar' => true, //active or deactive transliteration (mean convert strange characters in a..za..z0..9 characters) 'transliteration' => false, //convert spaces on files name , folders name $replace_with variable 'convert_spaces' => false, //convert spaces on files name , folders name value 'replace_with' => "_", // -1: there no lazy loading @ all, 0: lazy-load images, 0+: minimum number of files in directory // when lazy loading should turned on. 'lazy_loading_file_number_threshold' => 0, //******************************************* //images limit , resizing configuration //******************************************* // set maximum pixel width and/or maximum pixel height images // if set maximum width or height, oversized images converted limits. images smaller limit(s) unaffected // if don't need limit set both 0 'image_max_width' => 0, 'image_max_height' => 0, 'image_max_mode' => 'auto', /* # $option: 0 / exact = defined size; # 1 / portrait = keep aspect set height; # 2 / landscape = keep aspect set width; # 3 / auto = auto; # 4 / crop= resize , crop; */ //automatic resizing // // if set $image_resizing true script converts uploaded images image_resizing_width x image_resizing_height dimension // if set width or height 0 script automatically calculates other dimension // possible if upload big images script not work overcome increase php configuration of memory , time limit 'image_resizing' => false, 'image_resizing_width' => 0, 'image_resizing_height' => 0, 'image_resizing_mode' => 'auto', // same $image_max_mode 'image_resizing_override' => false, // if set true can specify bigger images $image_max_width & height otherwise if image_resizing // bigger $image_max_width or height converted values //****************** // default layout setting // // 0 => boxes // 1 => detailed list (1 column) // 2 => columns list (multiple columns depending on width of page) // can pass parameters using session var => $_session['rf']["view"]= // //****************** 'default_view' => 0, //set if filename truncated when overflow first row 'ellipsis_title_after_first_row' => true, //************************* //permissions configuration //****************** 'delete_files' => true, 'create_folders' => true, 'delete_folders' => true, 'upload_files' => true, 'rename_files' => true, 'rename_folders' => true, 'duplicate_files' => true, 'copy_cut_files' => true, // copy/cut files 'copy_cut_dirs' => true, // copy/cut directories 'chmod_files' => false, // change file permissions 'chmod_dirs' => false, // change folder permissions 'preview_text_files' => true, // eg.: txt, log etc. 'edit_text_files' => true, // eg.: txt, log etc. 'create_text_files' => true, // create files exts. defined in $editable_text_file_exts // can preview these type of files if $preview_text_files true 'previewable_text_file_exts' => array( 'txt', 'log', 'xml', 'html', 'css', 'htm', 'js' ), 'previewable_text_file_exts_no_prettify' => array( 'txt', 'log' ), // can edit these type of files if $edit_text_files true (only text based files) // can create these type of files if $create_text_files true (only text based files) // if want can add html,css etc. // security reasons it's not recommended! 'editable_text_file_exts' => array( 'txt', 'log', 'xml', 'html', 'css', 'htm', 'js' ), // preview google documents 'googledoc_enabled' => true, 'googledoc_file_exts' => array( 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx' ), // preview viewer.js 'viewerjs_enabled' => true, 'viewerjs_file_exts' => array( 'pdf', 'odt', 'odp', 'ods' ), // defines size limit paste in mb / operation // set 'false' no limit 'copy_cut_max_size' => 100, // defines file count limit paste / operation // set 'false' no limit 'copy_cut_max_count' => 200, //if of these limits reached, operation won't start , generate warning //********************** //allowed extensions (lowercase insert) //********************** 'ext_img' => array( 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg' ), //images 'ext_file' => array( 'doc', 'docx', 'rtf', 'pdf', 'xls', 'xlsx', 'txt', 'csv', 'html', 'xhtml', 'psd', 'sql', 'log', 'fla', 'xml', 'ade', 'adp', 'mdb', 'accdb', 'ppt', 'pptx', 'odt', 'ots', 'ott', 'odb', 'odg', 'otp', 'otg', 'odf', 'ods', 'odp', 'css', 'ai' ), //files 'ext_video' => array( 'mov', 'mpeg', 'm4v', 'mp4', 'avi', 'mpg', 'wma', "flv", "webm" ), //video 'ext_music' => array( 'mp3', 'm4a', 'ac3', 'aiff', 'mid', 'ogg', 'wav' ), //audio 'ext_misc' => array( 'zip', 'rar', 'gz', 'tar', 'iso', 'dmg' ), //archives /****************** * aviary config *******************/ 'aviary_active' => true, 'aviary_apikey' => "2444282ef4344e3dacdedc7a78f8877d", 'aviary_language' => "en", 'aviary_theme' => "light", 'aviary_tools' => "all", 'aviary_maxsize' => "1400", // add or modify aviary options below needed - json encoded when added configuration arrays can utilized needed //the filter , sorter managed through both javascript , php scripts because if have lot of //file in folder javascript script can't sort or filter all, filemanager switch php script. //the plugin automatic swich javascript php when current folder exceeds below limit of files number 'file_number_limit_js' => 500, //********************** // hidden files , folders //********************** // set names of folders want hidden (eg "hidden_folder1", "hidden_folder2" ) remember folders these names hidden (you can set exceptions in config.php files on folders) 'hidden_folders' => array(), // set names of files want hidden. remember these names hidden in folders (eg "this_document.pdf", "that_image.jpg" ) 'hidden_files' => array( 'config.php' ), /******************* * java upload *******************/ 'java_upload' => true, 'javamaxsizeupload' => 200, //gb //************************************ //thumbnail external use creation //************************************ // new image resized creation fixed path filemanager folder after uploading (thumbnails in fixed mode) // if want create images resized out of upload folder use external script can choose method, // can create more 1 image @ time add value in array // remember image creation respect folder hierarchy if inside source/test/test1/ new image create @ // path_from_filemanager/test/test1/ // ps if there isn't write permission in destination folder must set // 'fixed_image_creation' => false, //activate or not creation of 1 or more image resized fixed path filemanager folder 'fixed_path_from_filemanager' => array( '../test/', '../test1/' ), //fixed path of image folder current position on upload folder 'fixed_image_creation_name_to_prepend' => array( '', 'test_' ), //name prepend on filename 'fixed_image_creation_to_append' => array( '_test', '' ), //name appendon filename 'fixed_image_creation_width' => array( 300, 400 ), //width of image (you can leave empty if set height) 'fixed_image_creation_height' => array( 200, '' ), //height of image (you can leave empty if set width) /* # $option: 0 / exact = defined size; # 1 / portrait = keep aspect set height; # 2 / landscape = keep aspect set width; # 3 / auto = auto; # 4 / crop= resize , crop; */ 'fixed_image_creation_option' => array( 'crop', 'auto' ), //set type of crop // new image resized creation relative path inside upload folder after uploading (thumbnails in relative mode) // responsive filemanager can create automatically resized image inside upload folder, more 1 @ time // add value in array // image creation path relative if i'm inside source/test/test1 , upload image, path start here // 'relative_image_creation' => false, //activate or not creation of 1 or more image resized relative path upload folder 'relative_path_from_current_pos' => array( './', './' ), //relative path of image folder current position on upload folder 'relative_image_creation_name_to_prepend' => array( '', '' ), //name prepend on filename 'relative_image_creation_name_to_append' => array( '_thumb', '_thumb1' ), //name append on filename 'relative_image_creation_width' => array( 300, 400 ), //width of image (you can leave empty if set height) 'relative_image_creation_height' => array( 200, '' ), //height of image (you can leave empty if set width) /* # $option: 0 / exact = defined size; # 1 / portrait = keep aspect set height; # 2 / landscape = keep aspect set width; # 3 / auto = auto; # 4 / crop= resize , crop; */ 'relative_image_creation_option' => array( 'crop', 'crop' ), //set type of crop // remember text filter after close filemanager future session 'remember_text_filter' => false, ); return array_merge( $config, array( 'maxsizeupload' => ((int)(ini_get('post_max_size')) < $config['maxsizeupload']) ? (int)(ini_get('post_max_size')) : $config['maxsizeupload'], 'ext'=> array_merge( $config['ext_img'], $config['ext_file'], $config['ext_misc'], $config['ext_video'], $config['ext_music'] ), // list of options see: https://developers.aviary.com/docs/web/setup-guide#constructor-config 'aviary_defaults_config' => array( 'apikey' => $config['aviary_apikey'], 'language' => $config['aviary_language'], 'theme' => $config['aviary_theme'], 'tools' => $config['aviary_tools'], 'maxsize' => $config['aviary_maxsize'] ), ) );
and tinymce init
var tiny = tinymce.init({ language: "vi_vn", selector: "textarea", theme: "modern", height: 300, plugins: [ "advlist autolink link image lists charmap print preview hr anchor pagebreak code", "searchreplace wordcount visualblocks visualchars insertdatetime media nonbreaking", "table contextmenu directionality emoticons paste textcolor responsivefilemanager" ], toolbar1: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect", toolbar2: "| responsivefilemanager | link unlink anchor image | forecolor backcolor | print preview code ", image_advtab: true, external_filemanager_path: "/filemanager/", filemanager_title: "quản lý dữ liệu", external_plugins: { "filemanager": "/filemanager/plugin.min.js" } });
your server limiting upload size, change allow larger uploads.
Comments
Post a Comment