File(s) Upload attachment not showing in email
Permalink Browser Info Environment
I am using Formidable 2.1.3 to create our forms. We want job applicants to be able to upload their resumes for review. When I test the File(s) Upload element in the form everything seems to work okay except the emailed attachment. The uploaded file is entered with the correct name and size but it is not an active link to the file, it comes in as just text. How can I fix this?
Type: | Discussion |
---|---|
Status: | In Progress |
Let me be a little more clear. When, for example, I attach a pdf titled "resume.pdf" to the form to be sent with the email, when the recipient receives the email they cannot download the pdf because at that point it isn’t an attachment - it is just reads as text with the name "resume.pdf". I need to know how to make sure the resume file itself comes through as an attachment.
Hi Kesslerdesign,
I think I am experiencing the same issue. The attached file does get added to the File Manager and you can download it from there. But it would be nice if the email that comes from the submission of the form had a hyperlink to the source of the file rather than just the name of the file.
Dewebmakers, which PHP file would we need to amend in your package to make the name of the file include a hyperlink to the actual file?
Thanks
I think I am experiencing the same issue. The attached file does get added to the File Manager and you can download it from there. But it would be nice if the email that comes from the submission of the form had a hyperlink to the source of the file rather than just the name of the file.
Dewebmakers, which PHP file would we need to amend in your package to make the name of the file include a hyperlink to the actual file?
Thanks
I'm having the same issue, i have 5 forms which all include a file upload field and each one has its own file set where the files get uploaded to. I have the check box checked in the Attachments section in the Emails area to attached the uploaded file to the emails, but only one file set is available to choose from when there should be 5.
And like Kesslerdesign says it only shows the file name but no attachment in the email. As an admin I can go the file set and download the attachments but the person who is receiving the submissions will not have access to the site in order to download the attachments.
And like Kesslerdesign says it only shows the file name but no attachment in the email. As an admin I can go the file set and download the attachments but the person who is receiving the submissions will not have access to the site in order to download the attachments.
Hi,
Sorry for the late reply. Been on holiday and after returning I was very busy on several projects...
Can you check if the mail you are getting is in HTML?
There is a model in the models/formidable/element/fileupload.php directory.
In that file there should be a method "result" there is the function that will generate the result in the mailing. I thought is was a link already, but I guess I'm wrong...
Best,
Corretje
Sorry for the late reply. Been on holiday and after returning I was very busy on several projects...
Can you check if the mail you are getting is in HTML?
There is a model in the models/formidable/element/fileupload.php directory.
In that file there should be a method "result" there is the function that will generate the result in the mailing. I thought is was a link already, but I guess I'm wrong...
Best,
Corretje
Thanks for the reply, its seems that you have the correct code for the link.
I'm noticing that some attachments are coming through while others are not through the same form. I just received a submission the other day and the image was included as an attachment?
I'm noticing that some attachments are coming through while others are not through the same form. I just received a submission the other day and the image was included as an attachment?
Hi Corretje,
I have the same issue.
The attachment will shown in the backend area but not as an real attachment in the email of the recipient. In that case the recipient has no access to the file manager (backend) so that would really helping to send the attachment directly by email.
I have the same issue.
The attachment will shown in the backend area but not as an real attachment in the email of the recipient. In that case the recipient has no access to the file manager (backend) so that would really helping to send the attachment directly by email.
You need to add the attachment manually to the mail.
Check de attachment tab in the mailconfiguration.
Why some attachement aren't being send is a mystery. Maybe your spamfilter is blocking the file. Not sure what is going on. I've run some tests with some files and it seems to work on my end. Another issue could be the size of the attachments or the total of the attachments.
Best,
Corretje
Check de attachment tab in the mailconfiguration.
Why some attachement aren't being send is a mystery. Maybe your spamfilter is blocking the file. Not sure what is going on. I've run some tests with some files and it seems to work on my end. Another issue could be the size of the attachments or the total of the attachments.
Best,
Corretje
I get all information in the C5 backend (results) - attachment(s) included.
In the email which the recipient will get you see only the attachments-name an the flie-size, but it is not clickable or /and not attached.
btw. depends not on spam or file size or something like that.
I`m really helpless.
In the email which the recipient will get you see only the attachments-name an the flie-size, but it is not clickable or /and not attached.
btw. depends not on spam or file size or something like that.
I`m really helpless.
Hi,
2 things...
1. If you want the file to be an attachment (seperate in the mail) you need to add this to the mail configuration. The file wil be send with the mail.
2. A link, as you would like, is created by the addon.
To solve your problem (link in mail).... please check if your recipient allows HTML mails. If not the link is removed and you only see the text. You can check this by checking the mime-type of the mail. It cna be found in the header of the mail.
Best,
Corretje
2 things...
1. If you want the file to be an attachment (seperate in the mail) you need to add this to the mail configuration. The file wil be send with the mail.
2. A link, as you would like, is created by the addon.
To solve your problem (link in mail).... please check if your recipient allows HTML mails. If not the link is removed and you only see the text. You can check this by checking the mime-type of the mail. It cna be found in the header of the mail.
Best,
Corretje
"1. If you want the file to be an attachment (seperate in the mail) you need to add this to the mail configuration. The file wil be send with the mail."
May be it is a misunderstanding. The customer don`t want to send an attachment. The sender has to send an attachment by using the form to my customer.
"2. A link, as you would like, is created by the addon."
Sorry, but it doesn*t work yet.
"To solve your problem (link in mail).... please check if your recipient allows HTML mails. If not the link is removed and you only see the text. You can check this by checking the mime-type of the mail. It cna be found in the header of the mail."
I tried this with several emal-clients (Outlook, thunderbird, ...) - html works.
May be it is a misunderstanding. The customer don`t want to send an attachment. The sender has to send an attachment by using the form to my customer.
"2. A link, as you would like, is created by the addon."
Sorry, but it doesn*t work yet.
"To solve your problem (link in mail).... please check if your recipient allows HTML mails. If not the link is removed and you only see the text. You can check this by checking the mime-type of the mail. It cna be found in the header of the mail."
I tried this with several emal-clients (Outlook, thunderbird, ...) - html works.
So you do want to send an attachment with the mail. From the submitter to the recipient ( your customer). You need to add this in the mailconfiguration.
Why the attachment is not a link in the message is a weird issue. It should be there.
Can you add a link in your message manually. See if the link preserves when a mail is send.
Best,
Corretje
Why the attachment is not a link in the message is a weird issue. It should be there.
Can you add a link in your message manually. See if the link preserves when a mail is send.
Best,
Corretje
"So you do want to send an attachment with the mail. From the submitter to the recipient ( your customer). You need to add this in the mailconfiguration."
No, no, no - I`m the webdesigner and I do this for my customer. I know what you mean, but this is not the issue (see attachment - I don`t need this).
"Why the attachment is not a link in the message is a weird issue. It should be there.
Can you add a link in your message manually. See if the link preserves when a mail is send."
Done. The link works as it is manually integrated.
But the problem is not solved, sorry. See both attachments!
No, no, no - I`m the webdesigner and I do this for my customer. I know what you mean, but this is not the issue (see attachment - I don`t need this).
"Why the attachment is not a link in the message is a weird issue. It should be there.
Can you add a link in your message manually. See if the link preserves when a mail is send."
Done. The link works as it is manually integrated.
But the problem is not solved, sorry. See both attachments!
The problem is not solved.
Hi,
I've been looking in to this.... Please try the following.
Find the file /packages/formidable/models/element/fileupload.php
Find the following code:
and change this to:
Then save and try again.
Best,
Corretje
I've been looking in to this.... Please try the following.
Find the file /packages/formidable/models/element/fileupload.php
Find the following code:
public function result($value = array(), $seperator = ', ') { $ih = Loader::helper('image'); $_value = $this->value; if (!empty($value)) $_value = $value['value']; if (!empty($_value)) { foreach ((array)$_value as $file) { if (intval($file['file_id']) != 0) { $f = File::getByID($file['file_id']); if (is_object($f)) { if (in_array($file['ext'], $this->preview_extensions)) $files[] = '<div class="upload_preview" data_fID="'.$f->getFileID().'"> <a href="javascript:;">'.$ih->outputThumbnail($f, 50, 50, $file['name'], true).'</a> <a href="'.$f->getForceDownloadURL().'">'.$file['name'].'</a> ('.$this->convert_size($file['size']).')
Viewing 15 lines of 28 lines. View entire code block.
and change this to:
public function result($value = array(), $seperator = ', ') { $ih = Loader::helper('image'); $_value = $this->value; if (!empty($value)) $_value = $value['value']; if (!empty($_value)) { foreach ((array)$_value as $file) { //if (intval($file['file_id']) != 0) { $f = File::getByID($file['file_id']); if (is_object($f)) { if (in_array($file['ext'], $this->preview_extensions)) $files[] = '<div class="upload_preview" data_fID="'.$f->getFileID().'"> <a href="javascript:;">'.$ih->outputThumbnail($f, 50, 50, $file['name'], true).'</a> <a href="'.$f->getForceDownloadURL().'">'.$file['name'].'</a> ('.$this->convert_size($file['size']).')
Viewing 15 lines of 28 lines. View entire code block.
Then save and try again.
Best,
Corretje
Thank you for the code ( // ).
The link of the attachment will shown (see attached screenshot), but the target does not show the real file and is not linking to file: http://domain-name.com/index.php/download_file/force/0/...
The link of the attachment will shown (see attached screenshot), but the target does not show the real file and is not linking to file: http://domain-name.com/index.php/download_file/force/0/...
Then there is only one option left...
The file isn't uploaded or uploaded correctly. The results method you just changed, checks if a file is a real object in the filemanager. Try it with different file sizes and file types. See if there is some change.
Best,
Corretje
The file isn't uploaded or uploaded correctly. The results method you just changed, checks if a file is a real object in the filemanager. Try it with different file sizes and file types. See if there is some change.
Best,
Corretje
Hello all,
These changes were give to us by and seemed to fix the problem. Changes to the /packages/formidable/models/formidable/mailing.php around line 310
// Set Message
$_message = $this->prepareMessage();
$mh->setBodyHTML($_message);
$mh->setBody($th->sanitize($_message));
// Set attachments
$_attachments = array();
if (!empty($this->attachments))
$_attachments += $this->attachments;
$files_to_mail = $this->files_to_mail;
if ($this->attachments_element == 1 && !empty($files_to_mail)){
/* changed by Hutman 08/07/15 */
/*
foreach ((array)$this->attachments_element_value as $_element)
foreach ((array)$files_to_mail[$_element] as $_file)
$_attachments[] = $_file['file_id'];
*/
foreach ((array)$files_to_mail as $_key => $_files){
if(count($_files) > 0){
foreach($_files as $_file){
$_attachments[] = $_file['file_id'];
}
}
}
}
if (sizeof($_attachments) > 0) {
foreach ($_attachments as $_attachment) {
if (empty($_attachment))
continue;
$f = File::getByID(intval($_attachment));
if (intval($f->getFileID()) != 0) {
$fv = $f->getApprovedVersion();
$mh->addAttachment($fv->getPath(), $fv->getFileName(), $fv->getMimeType());
}
}
}
// Send the mail!
$mh->sendMail(true);
$mh->reset();
return true;
}
Best,
kesslerdesign
These changes were give to us by and seemed to fix the problem. Changes to the /packages/formidable/models/formidable/mailing.php around line 310
// Set Message
$_message = $this->prepareMessage();
$mh->setBodyHTML($_message);
$mh->setBody($th->sanitize($_message));
// Set attachments
$_attachments = array();
if (!empty($this->attachments))
$_attachments += $this->attachments;
$files_to_mail = $this->files_to_mail;
if ($this->attachments_element == 1 && !empty($files_to_mail)){
/* changed by Hutman 08/07/15 */
/*
foreach ((array)$this->attachments_element_value as $_element)
foreach ((array)$files_to_mail[$_element] as $_file)
$_attachments[] = $_file['file_id'];
*/
foreach ((array)$files_to_mail as $_key => $_files){
if(count($_files) > 0){
foreach($_files as $_file){
$_attachments[] = $_file['file_id'];
}
}
}
}
if (sizeof($_attachments) > 0) {
foreach ($_attachments as $_attachment) {
if (empty($_attachment))
continue;
$f = File::getByID(intval($_attachment));
if (intval($f->getFileID()) != 0) {
$fv = $f->getApprovedVersion();
$mh->addAttachment($fv->getPath(), $fv->getFileName(), $fv->getMimeType());
}
}
}
// Send the mail!
$mh->sendMail(true);
$mh->reset();
return true;
}
Best,
kesslerdesign
HI Kessler,
thx for your help. I changed the code but the result is still the same (force/0)
http://domain-name.com/index.php/download_file/force/0/...
G.
thx for your help. I changed the code but the result is still the same (force/0)
http://domain-name.com/index.php/download_file/force/0/...
G.
I tried it with different file types - but the same result happened.
If the ID of the file is 0 the file can't be found or isn't there. You need to check the filemanager to see if the file is uploaded... Is it in the filemanager?
Yes, the file is shown in the filemanager.
Files uploaded can be added as attachments in the mail, but not as links in the message itself.
Best,
Corretje