kerryzhao Posted December 3, 2010 Share Posted December 3, 2010 When i add some products with attachment, I need a much longer file name to describe my attachment.Can anyone suggest me?Thanks. Link to comment Share on other sites More sharing options...
Emmanuel Paris Posted December 3, 2010 Share Posted December 3, 2010 In classes/attachment.php, change value 32 : protected $fieldsSizeLang = array('name' => 32); 2 Link to comment Share on other sites More sharing options...
blueraccoon Posted March 27, 2013 Share Posted March 27, 2013 Hi, Does anyone know how to edit the filename length in 1.5? I have looked every where but can't locate it. Cheers. Link to comment Share on other sites More sharing options...
[email protected] Posted April 23, 2013 Share Posted April 23, 2013 Hi, Does anyone know how to edit the filename length in 1.5? I have looked every where but can't locate it. Cheers. if you want change length in 1.5 you need change in database varchar length (for example to 128) of column file_name in table {prefix}_attachment next what you need to do is change two value in: \controllers\admin\AdminProductsController.php if (!Validate::isGenericName(Tools::getValue('attachment_name_'.(int)($language['id_lang'])))) $this->errors[] = Tools::displayError('Invalid Name'); elseif (Tools::strlen(Tools::getValue('attachment_name_'.(int)($language['id_lang']))) > 32) $this->errors[] = sprintf(Tools::displayError('Name is too long (%d chars max).'), 32); if (!Validate::isCleanHtml(Tools::getValue('attachment_description_'.(int)($language['id_lang'])))) $this->errors[] = Tools::displayError('Invalid description'); find this code and edit line with value set to 32 to value you have defined in database in my case there are line 371 and 372 after that open file \classes\Attachment.php and change line 51 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 32) with this same value as before in database and previous file 2 Link to comment Share on other sites More sharing options...
blueraccoon Posted April 23, 2013 Share Posted April 23, 2013 Excellent, many thanks for this. It turned out I hadn't changed the value in \classes\Attachment.php I also had to edit the varchar length in column file_name of table {prefix}_attachment_lang in order to get it to work. Thanks for your help. Link to comment Share on other sites More sharing options...
Recommended Posts