Jump to content

Prestashop 1.6.0.6. Can't upload pdf files in CMS pages


Recommended Posts

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

  • 2 weeks later...

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 by ChDUP (see edit history)
  • Like 3
Link to comment
Share on other sites

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

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

  • 2 weeks later...

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

  • 2 weeks later...
  • 4 weeks later...
  • 1 month later...
  • 2 weeks later...

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

  • 2 weeks later...
  • 6 months later...

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.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
  • 6 months later...

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

  • 3 months later...
Guest locen

Hi, I have problems when i add image in cms page. i can't add image by click 

post-1119372-0-71241900-1459406351_thumb.png

but i should follow these passages  to insert images. 

post-1119372-0-58574700-1459406387_thumb.png

can someone help me? 

Link to comment
Share on other sites

  • 3 months later...
  • 3 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...