質問 > フロント機能 > お問い合わせフォームに添付(zip) |
フロント機能
フラット表示 | 前のトピック | 次のトピック |
投稿者 | スレッド |
---|---|
wsmfp327 |
投稿日時: 2012/3/14 9:32
対応状況: −−−
|
新米 登録日: 2012/3/6 居住地: 投稿: 6 |
お問い合わせフォームに添付(zip) 使用ver 2.11.5
参考にしたスレッド http://xoops.ec-cube.net/modules/newbb/viewtopic.php?viewmode=flat&order=ASC&topic_id=5292&forum=10 お問い合わせフォームにzipファイルを添付したいと考えています。 SC_SendMail.php内のsendMailを下記のように書き換えた所eccube/html/contactにおいたtest.zipを添付することができました。 --------------------------------- function sendMail($filename) { $this->objMailMime = new Mail_mime(); $this->objMailMime->setTXTBody(mb_convert_encoding($this->body, 'JIS')); $this->objMailMime->addAttachment('test.zip', 'application/octet-stream', mb_convert_encoding("test.zip", 'ISO-2022-JP', 'SJIS')); $param = array( "text_charset" => "iso-2022-jp", //TEXT用 "text_encoding" => "base64" //TEXT用 ); $this->body = $this->objMailMime->get($param); $header = $this->objMailMime->headers($this->getFILEHeader()); $result = $this->objMail->send($this->getRecip(), $header, $this->body); if (PEAR::isError($result)) { GC_Utils_Ex::gfPrintLog($result->getMessage()); GC_Utils_Ex::gfDebugLog($header); return false; } return true; } --------------------------------- このtest.zipの部分を$filenameに書き換えお問い合わせのフォームから添付ファイルを指定したいのですがうまくいきません。添付ファイル名自体を取得できていない(フォーム確認画面にファイル名が表示されない)ようなのですがどのようにすればよいでしょうか? data/Smarty/templates/○○/upform.tpl内に追加 --------------------------------- <form name="form1" method="post" action="?" enctype="multipart/form-data"> <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> <input type="hidden" name="mode" value="confirm" /> <input type="file" name="filename" /> <input type="image" onmouseover="chgImgImageSubmit('<!--{$TPL_URLPATH}-->img/button/btn_confirm_on.jpg', this)" onmouseout="chgImgImageSubmit('<!--{$TPL_URLPATH}-->img/button/btn_confirm.jpg', this)" src="<!--{$TPL_URLPATH}-->img/button/btn_confirm.jpg" alt="確認ページへ" name="confirm" /> </form> --------------------------------- data/class/pages/contact/LC_Page_Contact.php内に追加(ここの書き方が悪いと思うのですが…) --------------------------------- function lfInitParam(&$objFormParam) { $objFormParam->addParam("添付", 'filename'); } --------------------------------- よろしくお願いいたします。 |
フラット表示 | 前のトピック | 次のトピック |
題名 | 投稿者 | 日時 |
---|---|---|
» お問い合わせフォームに添付(zip) | wsmfp327 | 2012/3/14 9:32 |
Re: お問い合わせフォームに添付(zip) | PWS | 2012/3/14 9:49 |
Re: お問い合わせフォームに添付(zip) | wsmfp327 | 2012/3/14 11:02 |
Re: お問い合わせフォームに添付(zip) | PWS | 2012/3/15 9:22 |
Re: お問い合わせフォームに添付(zip) | wsmfp327 | 2012/3/17 10:00 |