jorge_gil_pedernal Posted June 16, 2014 Share Posted June 16, 2014 Hi I can't upload any type of file (except images) using file manager of tinymce. I have read the code and I think that file manager should be able to upload several file types, but I can't, It seems to upload correctly the file but then the file doesn't appear. It happens in CMS and blog pages (I've installed simple blog). I think that is a matter of file manager or its connection to tinymce. Can anyone help me? Thanks in advance. Regards Jorge Gil Link to comment Share on other sites More sharing options...
ChDUP Posted June 30, 2014 Share Posted June 30, 2014 (edited) change file admin/filemanager/upload.php lines 64 to 69 replace with if (in_array(fix_strtolower($info['extension']), $ext_img) && @getimagesize($tempFile) != false) $is_img = true; elseif (in_array(fix_strtolower($info['extension']), $ext_file)) { $is_img = false; $is_file = true; } else { $is_img = false; $is_file = false; } if ($is_file) { move_uploaded_file($tempFile, $targetFile); chmod($targetFile, 0755); $memory_error = false; } elseif ($is_img) you have to change img/cms/.htaccess too and include pdf extension Edited June 30, 2014 by ChDUP (see edit history) 3 Link to comment Share on other sites More sharing options...
vekia Posted June 30, 2014 Share Posted June 30, 2014 nice snippet it works also with older releases? have you tried it? i think so, but it's worth to ask Link to comment Share on other sites More sharing options...
ChDUP Posted June 30, 2014 Share Posted June 30, 2014 I haven't tried but I don't think because filemanager is not the same in Presta <1.6 For 1.4 versions, maybe see this topic : http://www.prestashop.com/forums/topic/146055-upload-pdf-files-to-prestashop-14-trough-cms-editor/ Link to comment Share on other sites More sharing options...
Jean.M Posted July 7, 2014 Share Posted July 7, 2014 change file admin/filemanager/upload.php lines 64 to 69 replace with...... you have to change img/cms/.htaccess too and include pdf extension Hello, Thanks for your post. I have followed your instruction on prestashop 1.6 . I can see the file in "img/cms/" with ftp yet it is not visible with the uploader. Thanks for your help Link to comment Share on other sites More sharing options...
yari92 Posted July 10, 2014 Share Posted July 10, 2014 Hello, Thanks for your post. I have followed your instruction on prestashop 1.6 . I can see the file in "img/cms/" with ftp yet it is not visible with the uploader. Thanks for your help I have same issue. Link to comment Share on other sites More sharing options...
prestaet Posted July 21, 2014 Share Posted July 21, 2014 change file admin/filemanager/upload.php lines 64 to 69 replace with if (in_array(fix_strtolower($info['extension']), $ext_img) && @getimagesize($tempFile) != false) $is_img = true; elseif (in_array(fix_strtolower($info['extension']), $ext_file)) { $is_img = false; $is_file = true; } else { $is_img = false; $is_file = false; } if ($is_file) { move_uploaded_file($tempFile, $targetFile); chmod($targetFile, 0755); $memory_error = false; } elseif ($is_img) you have to change img/cms/.htaccess too and include pdf extension Can you please show me how to update the .htaccess file as well. i had already updated the upload.php file. Sorry i am a newbie to prestashop and still learning. Your help is greatly appreciated. Link to comment Share on other sites More sharing options...
ChDUP Posted July 22, 2014 Share Posted July 22, 2014 prestaet, in this file : img/cms/.htaccess just add "pdf" in this line <Files ~ "(?i)^.*\.(jpg|jpeg|gif|png|pdf)$" Link to comment Share on other sites More sharing options...
Jean.M Posted July 22, 2014 Share Posted July 22, 2014 is it working for someone on prestashop 1.6??? Thanks Link to comment Share on other sites More sharing options...
ChDUP Posted July 23, 2014 Share Posted July 23, 2014 It works for me, with Presta 1.6.0.6 You can also track the issue here : http://forge.prestashop.com/browse/PSCSX-2580 1 Link to comment Share on other sites More sharing options...
metmichiel Posted August 3, 2014 Share Posted August 3, 2014 It works for me, with Presta 1.6.0.6 You can also track the issue here : http://forge.prestashop.com/browse/PSCSX-2580 Thanks! This workaround is good Link to comment Share on other sites More sharing options...
Giordx Posted August 26, 2014 Share Posted August 26, 2014 (edited) Thanks ChDUP, the upload works well, but I don't see the file using CMS. In .htaccess I have only that line: php_flag engine off Deleting the .htaccess everything works well Edited August 26, 2014 by velit (see edit history) Link to comment Share on other sites More sharing options...
developer_php Posted October 14, 2014 Share Posted October 14, 2014 HI! it's works well but we can't see pdf file in filemanager how to resolve it? Link to comment Share on other sites More sharing options...
tomablan Posted October 22, 2014 Share Posted October 22, 2014 Has anyone found anything ? No feedbacks yet on the opened issue... Link to comment Share on other sites More sharing options...
ChDUP Posted October 24, 2014 Share Posted October 24, 2014 maybe see this fix : https://github.com/PrestaShop/PrestaShop/commit/940cf780eb8ce90612ca0e0826b4d05493a4b760 Link to comment Share on other sites More sharing options...
tomablan Posted October 24, 2014 Share Posted October 24, 2014 It has (partly) solved the problem. If you go through the "add an image" button, you won't see any file other than images. But if you try the "Edit > Insert a link" entry, the explorer here will show all files. One thing according to the last fix on js/tinymce.inc.js : don't remove "media" from insert menu. Link to comment Share on other sites More sharing options...
me-and-prestashop Posted November 3, 2014 Share Posted November 3, 2014 I was not able to upload PDFs - even after applying the Git hub fix above. It turned out that my test PDFs where 3Mb+ and that the hosts default upload limit where 2Mb. Take a look at your php settings. Changing the setting to upload_max_filesize=18M; did it for me. Link to comment Share on other sites More sharing options...
vekia Posted November 3, 2014 Share Posted November 3, 2014 there are also several other variables from settings like max_post_size Link to comment Share on other sites More sharing options...
babak1410 Posted May 14, 2015 Share Posted May 14, 2015 change file admin/filemanager/upload.php lines 64 to 69 replace with if (in_array(fix_strtolower($info['extension']), $ext_img) && @getimagesize($tempFile) != false) $is_img = true; elseif (in_array(fix_strtolower($info['extension']), $ext_file)) { $is_img = false; $is_file = true; } else { $is_img = false; $is_file = false; } if ($is_file) { move_uploaded_file($tempFile, $targetFile); chmod($targetFile, 0755); $memory_error = false; } elseif ($is_img) you have to change img/cms/.htaccess too and include pdf extension ------------------------------ ( prestaet, in this file : img/cms/.htaccess just add "pdf" in this line <Files ~ "(?i)^.*\.(jpg|jpeg|gif|png|pdf)$" ) work for me with prestashop 1.6.0.6. thanks. 1 Link to comment Share on other sites More sharing options...
Gaiadreams Posted May 29, 2015 Share Posted May 29, 2015 Excellent! Thanks for the trick, works perfect for me on 1.6.9 Link to comment Share on other sites More sharing options...
Chazz Posted December 9, 2015 Share Posted December 9, 2015 change file admin/filemanager/upload.php lines 64 to 69 replace with if (in_array(fix_strtolower($info['extension']), $ext_img) && @getimagesize($tempFile) != false) $is_img = true; elseif (in_array(fix_strtolower($info['extension']), $ext_file)) { $is_img = false; $is_file = true; } else { $is_img = false; $is_file = false; } if ($is_file) { move_uploaded_file($tempFile, $targetFile); chmod($targetFile, 0755); $memory_error = false; } elseif ($is_img) you have to change img/cms/.htaccess too and include pdf extension Hello all, I tried this on 1.6.1.2 and it doesn´t seem to work. Any ideas? Link to comment Share on other sites More sharing options...
Guest locen Posted April 1, 2016 Share Posted April 1, 2016 Hi, I have problems when i add image in cms page. i can't add image by click but i should follow these passages to insert images. can someone help me? Link to comment Share on other sites More sharing options...
A.Polounovsky Posted July 12, 2016 Share Posted July 12, 2016 Hi Same problem in 1.6.1.5 version on fresh install.... this bug is doesn't fix.... Upload is good Show is not good Link to comment Share on other sites More sharing options...
-iD- Posted November 8, 2016 Share Posted November 8, 2016 In Prestashop 1.6 you can add PDF to your CMS pages without making any changes in the code.Go to your CMS page -> Edit :- Insert link- Chose from files- Add files- Select your file Se my screen captures below Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now