Page 1 of 1

CGBetter forms file attachments

Posted: Mon Oct 07, 2019 8:34 pm
by ISSL
Hi All,

Has anyone used CGBetterForms with file attachment in the form, as i just can not get this to work and need some advice

so used this in the template ...

<div class="form__item">
<label for="cv" class="form__label">Upload your CV</label>
<input type="file" id="cv" name="cv" value="{$form_data->cv}" data-cgbf-accept="application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.oasis.opendocument.text,application/vnd.apple.pages,application/x-iwork-pages-sffpages">
</div>


But what should go in the form handler to make it send the file with the email?

Kind Regards

Paul

Re: CGBetter forms file attachments

Posted: Mon Oct 07, 2019 10:48 pm
by DIGI3
I don't think CGBF currently has the ability to create a file attachment, probably just a link to the file. You may need to file a feature request, and/or offer to sponsor or co-sponsor (I recall seeing a few others asking about it, so perhaps it can be crowd-funded).

Re: CGBetter forms file attachments

Posted: Tue Oct 08, 2019 5:20 am
by ISSL
HI,

A link to the file would be good, how can i provide a link to the uploaded file, every option i try just does not work.

Paul

Re: CGBetter forms file attachments

Posted: Tue Oct 08, 2019 2:32 pm
by DIGI3
I just did a quick test, with this in my template:

Code: Select all

  <label>upload file
    <input type="file" name="file">
  </label>
And the {$file} field was available for use in templates - it contained the full url to the file. So in your email you could include a link like:

Code: Select all

<a href="{$file}">Download file</a>