Подскажите как сделать отправку файла из контактной формы? Письма приходят без файла
Сделал так:
information/contact.tpl
<input type="file" name="file" id="file1" />
/information/contact.php 22 строка
if (file_exists($_FILES['file']['tmp_name'])) {
$tempdir = (DIR_DOWNLOAD)."/temp/"; //<-----------absolute path to opencart /yoursitefolder/download/temp/ (located in config.php) $fileName = $_FILES['file']['name']; $imageTemp = $tempdir.$fileName; move_uploaded_file($_FILES['file']['tmp_name'], $tempdir.$fileName); $mail->addAttachment($tempdir.$fileName); }
и на 74 строку
if (isset($this->error['file'])) { $this->data['error_file'] = $this->error['file']; } else { $this->data['error_file'] = ''; }
и на 106 строку
if (isset($this->request->post['file'])) {
$this->data['file'] = $this->request->post['file']; }