Откройте файл
/controllers/front/ProductController.php
Код:
$tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS');
if ($error || (!$tmp_name || !move_uploaded_file($file['tmp_name'], $tmp_name)))
return false;
/* Original file */
if (!ImageManager::resize($tmp_name, _PS_UPLOAD_DIR_.$file_name))
$this->errors[] = Tools::displayError('An error occurred during the image upload process.');
/* A smaller one */
elseif (!ImageManager::resize($tmp_name, _PS_UPLOAD_DIR_.$file_name.'_small', $product_picture_width, $product_picture_height))
$this->errors[] = Tools::displayError('An error occurred during the image upload process.');
elseif (!chmod(_PS_UPLOAD_DIR_.$file_name, 0777) || !chmod(_PS_UPLOAD_DIR_.$file_name.'_small', 0777))
$this->errors[] = Tools::displayError('An error occurred during the image upload process.');
else
$this->context->cart->addPictureToProduct($this->product->id, $indexes[$field_name], Product::CUSTOMIZE_FILE, $file_name);
замените на:
Код:
if (!move_uploaded_file($file['tmp_name'], _PS_UPLOAD_DIR_.$file_name))
return false;
elseif (!chmod(_PS_UPLOAD_DIR_.$file_name, 0777))
$this->errors[] = Tools::displayError('An error occurred during the image upload process.');
else
$this->context->cart->addPictureToProduct($this->product->id, $indexes[$field_name], Product::CUSTOMIZE_FILE, $file_name);
В код необходимо добавить проверку на расширение файла или отключить для директории
upload выполнение.
Также необходимо переписать шаблон
/themes/тема/product.tpl