![]() |
CI + tinyMce editor + tinybrowser file uploader - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: CI + tinyMce editor + tinybrowser file uploader (/showthread.php?tid=22183) |
CI + tinyMce editor + tinybrowser file uploader - El Forum - 08-31-2009 [eluser]amipaxs[/eluser] hi, I use the following directory tree on the server , i used to get error status 404 when uploading files through tinybrowser, even though i could create folders inside the media folder. I deleted .htaccess file so i'm using index.php again on the URL , now i get error 406 during the upload process. -css -images -js ---tinyMce(editor) ----plugins -----tinybrowser -media (upload directory -777 permission) --thumbs -system (ci files) .htaccess index.php any ideas ?? CI + tinyMce editor + tinybrowser file uploader - El Forum - 09-01-2009 [eluser]umefarooq[/eluser] have u check the tinybrowser config file with the name config_tinybrowser.php where you can find the file upload path which tinybrowser automatically creating when you call it if directory not exists. Code: $tinybrowser['path']['image'] = '/useruploads/images/'; // Image files location - also creates a '_thumbs' subdirectory within this path to hold the image thumbnails another thing also share .htaccess file CI + tinyMce editor + tinybrowser file uploader - El Forum - 09-01-2009 [eluser]arjo[/eluser] Hi, I have also a (path) problem with CI + tinyMCE + tinyBrowser. Here is the relevant part of my config_tinybrowser.php: Code: $tinybrowser['docroot'] = '/home/vakgroep/algemeen/fed/'; When I upload an image (sander.jpg) using tinybrowser, the file is created on the server: /home/vakgroep/algemeen/fed/upload/images/sander.jpg So far so good. But the image does not appear in the browse list of the tinybrowser dialog window. And after insert into a document, timyMCE f*cks up my path creating in the html: Code: <img src="../../../../upload/images/sander.jpg"> Here's my .htaccess as well: Code: RewriteEngine on As you can see, the folder upload is listed as an execption for the rewrite and CI will leave it alone. I think it has something todo with the absolute path; the upload and subdir creation is working fine, but showing images and thumbs and referring to them is NOT working. I wish I could use the CI function base_url() to fix this but I don't know where to do this... Anyone having problems like mentioned above? And a solution? many thanks in advance, Arjo CI + tinyMce editor + tinybrowser file uploader - El Forum - 09-01-2009 [eluser]umefarooq[/eluser] now here is the solution of your problem you have to set some values in you tinymce_config.js Code: remove_script_host : false, then your image path will be like Code: <img src="http://www.yorsite.come/upload/images/sander.jpg"> and let you tinybrowser setting as it is Code: $tinybrowser['docroot'] = $_SERVER['DOCUMENT_ROOT']; if you have any trouble just post your comment here ill check this for more help you can check tinymce doc http://wiki.moxiecode.com/index.php/TinyMCE:Configuration CI + tinyMce editor + tinybrowser file uploader - El Forum - 09-02-2009 [eluser]amipaxs[/eluser] hi thanks for answering my post, here are more deatils about my settings: tinybrowser_config.php: $tinybrowser['integration'] = 'tinymce'; $tinybrowser['docroot'] = '/home/rcab09/public_html'; $tinybrowser['unixpermissions'] = 0777; $tinybrowser['path']['image'] = '/media/images/'; (777 permissions) $tinybrowser['link']['image'] = $tinybrowser['path']['image']; my .htaccess is RewriteEngine on RewriteCond $1 !^(index\.php|images|captcha|css|js|uploads|media|robots\.txt) RewriteRule ^(.*)$ index.php/$1 [L] by the way, $_SERVER['DOCUMENT_ROOT'] produced /usr/local/htdocs in my virtualhost. i'm attaching a pic about the error with .htaccess, without .htaccess it produces error 406, then could it be mod_security the culprit? CI + tinyMce editor + tinybrowser file uploader - El Forum - 09-02-2009 [eluser]amipaxs[/eluser] umefarooq , could not find tinymce_config.js,, do you mean my settings in the controller? i'll test your suggestions here. tinymce settings in the controller , $this->tinyMce = ' <!-- TinyMCE --> call javascript 1: script type="text/javascript" src="'.base_url().'js/tiny_mce/tiny_mce.js" call javascript 2: script type="text/javascript" src="'.base_url().'js/tiny_mce/plugins/tinybrowser/tb_tinymce.js.php script type="text/javascript" tinyMCE.init({ //General option mode : "textareas", theme : "advanced", plugins: "table,contextmenu,advimage,advlink,paste,fullscreen,xhtmlxtras,preview", theme_advanced_toolbar_align: "left", theme_advanced_buttons1: "formatselect,outdent,indent,seperator,undo,redo,|,link,unlink,anchor,image,cleanup,help,code", theme_advanced_buttons2: "justifyleft,justifycenter,justifyright,justifyfull,|,bold,italic,separator,bullist,numlist,link,separator,imagepopup,table,separator,sub,sup", theme_advanced_buttons3: "preview", theme_advanced_toolbar_location: "top", theme_advanced_path_location : "bottom", theme_advanced_resizing : true, content_css : "'. base_url().'/css/editable.css", theme_advanced_blockformats : "p", file_browser_callback : "tinyBrowser" }); [removed] <!-- /TinyMCE --> '; } CI + tinyMce editor + tinybrowser file uploader - El Forum - 09-03-2009 [eluser]umefarooq[/eluser] you have to put following line of code in tinyMCE.init along with you rest of settings. sorry for the file i have created tinymce_conf.js separate which is keeping only tinMCE.init Code: tinyMCE.init({ CI + tinyMce editor + tinybrowser file uploader - El Forum - 09-04-2009 [eluser]arjo[/eluser] [quote author="umefarooq" date="1251888704"]now here is the solution of your problem you have to set some values in you tinymce_config.js Code: remove_script_host : false, then your image path will be like Code: <img src="http://www.yorsite.come/upload/images/sander.jpg"> and let you tinybrowser setting as it is Code: $tinybrowser['docroot'] = $_SERVER['DOCUMENT_ROOT']; if you have any trouble just post your comment here ill check this for more help you can check tinymce doc http://wiki.moxiecode.com/index.php/TinyMCE:Configuration[/quote] Hi, When I use the code above, the select after clicking the thumbnail doesn't work anymore so the browser dialog isn't closed and the image isn't transferred into the tinymce textarea html... What I do now is convert the path '../../../..' to 'base_url()' using the function str_replace in my php model script where I save the content to the database. But thanks anyway! Arjo CI + tinyMce editor + tinybrowser file uploader - El Forum - 01-10-2010 [eluser]amipaxs[/eluser] Solved! It was all related to a server configuration blocking the upload, now I use a dedicated server and it works perfectly! |