Regarding Contact Form File Attachment

106 views
Skip to first unread message

Prashant Birajdar

unread,
May 18, 2012, 7:49:53 AM5/18/12
to Joomla! General Development
Code for file upload
I am using this code for frontend contact form
-----------------------------------------------------------------

<label for="attachFile">
&nbsp;<?php echo JText::_( 'Attach File' );?>:
</label>
<br />
<div class="nopad"><input type="file" name="attachFile"
id="attachFile" class="inputbox" value="" /></div>
<br />

-------------------------------------------------------------
in controller.php

$attachFile = JRequest::getVar( 'attachFile', '', 'files',
'array' );

$mail->addAttachment($attachFile); // For attach a
file to email

This code attaches a file in email as a different name like
phpZDFTUg;
This file has correct file size in gmail but don't have correct
filename and its extension.

Reply all
Reply to author
Forward
0 new messages