Jump to content

Upload PDF files to Prestashop 1.4 trough cms editor


Recommended Posts

  • 2 months later...

you cand find in www/admin-newname/ajaxfilemanager/inc a file : config.base.php

 

you must edit and change the following lines:

define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,pdf');// //

define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,pdf');

 

and

 

define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,jpg,png,pdf');

change in (add .pdf):

define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,jpg,png,pdf');

 

 

That's it.

 

Good luck!

  • Like 3
Link to comment
Share on other sites

  • 8 months later...

Hi! Thank's for that but i still have got a problem:

 

i show you my lines:

 

 

define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,pdf');// //
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');//
define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,jpg,png,pdf');
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); //
define('CONFIG_UPLOAD_INVALID_EXTS', '');

 

And when i want upload my .pdf clickin on the "insert / edit image" icon it says the file is not allowed too...

Same thing clickin on the "insert / edit link" icon.

 

Edit: Oh! it work but i don't know why when i try with a 17Mo File, it fail... Is there a limit?

Edited by elmadie (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Hi! Thank's for that but i still have got a problem:

 

i show you my lines:

 

 

define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,pdf');// //
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');//
define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,jpg,png,pdf');
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); //
define('CONFIG_UPLOAD_INVALID_EXTS', '');

 

And when i want upload my .pdf clickin on the "insert / edit image" icon it says the file is not allowed too...

Same thing clickin on the "insert / edit link" icon.

 

Edit: Oh! it work but i don't know why when i try with a 17Mo File, it fail... Is there a limit?

 

Yes, You can change the limit in the same archive

 

Hello, I tried this, but It seems doesn't work for me (PS 1.5.0.17)

Could anyone help?

 

Maybe it is also a problem with the size?

Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...

I use PS 1.5.4 and also for me it does not work unfortunately. The lines are slightly different than in previous versions.

 

config.jpg

 

Since it is very important for me to let the customer to upload files in pdf format, I ask for help.

 

Thanks

Link to comment
Share on other sites

I can't try it now, but try to do this:

 

 

define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css,pdf'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid

 

define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste

define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,pdf');// //

//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');//

define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,jpg,png,pdf');

//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt,pdf'); //

define('CONFIG_UPLOAD_INVALID_EXTS', '');

Link to comment
Share on other sites

  • 4 weeks later...

HI me too got same problem, I am able to upload the pdf files,

But when i try to insert pdf file in product description using iframe, everything goes fine,

but it throw error when try to save it.

error:

 

 

Not Acceptable

An appropriate representation of the requested resource /adm/index.php could not be found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

Using prestashop version 1.5.2.0

Link to comment
Share on other sites

  • 3 weeks later...

Hello,

 

I am using the new version PrestaShop 1.5.4.1 I have also applied the changes above to may config.base.php (for customers to upload PDF or any other file extentions) However it does not seem to work when I test the upload. I get the following message:

There is 1 error

  1. Image format not recognized, allowed formats are: .gif, .jpg, .png

below are the changes I made to my config.base according to the instruction above.

 

define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste

define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,pdf');// //

//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');//

define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,jpg,png,pdf');

//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); //

define('CONFIG_UPLOAD_INVALID_EXTS', 'gif,jpg,png,pdf');

 

Some help to resolve this issue to be able to have customers upload PDF or any other extensions would be appreciative.

 

Thanks

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
×
×
  • Create New...