file attachment not works with custom field
-
Hello Guys,
I’m trying to attach a file from a hidden field on the form.
Currently i have this three ways to try to get the file. This are on the CF7 ‘Form’ (body) tab:
[checkbox* checkbox-167 id:seleccion use_label_element exclusive "file1" "file2"] [dynamichidden documento id:doc "not found"] <input type="hidden" id="selected-file" name="selected-file">
Ok, now with some JS i add the values for the hidden input and also for the Chekbox. I try a lot of changes on the JS but the main idea is…
jQuery(document).ready(function( $ ){ $('#seleccion .first input[name="checkbox-167"]').val('uploads/2022/10/file1.pdf'); $('#seleccion .last input[name="checkbox-167"]').val('uploads/2022/10/file2.pdf'); var eldoc = $("input[type=checkbox][name=checkbox-167]:checked").val(); $('#seleccion input[type="checkbox"]').click(function(){ var value = $(this).val(); $('#doc').val(value); $('#selected-file').val(value); }); });
I try with different paths /uploads/, uploads/, /wp-content/uploads/ https://thewebsite.com/wp-content/uploads/ but nothing works.
On the CF7 ‘Mail’ tab i try to add the file and… On the body of the email, i get the field as needed, but on the file attachements not works.
[checkbox-167] return: uploads/2022/10/file1.pdf
[documento] return: uploads/2022/10/file1.pdf
[selected-file] return: uploads/2022/10/file1.pdf
I try add all the fields on the “Fields Attachments” Box but nothing works, the files are not attached. I try add only one, two and all the document fields at the same time.
The wordpress attachment files seems Works Ok because, if i “add” the file as plain text (uploads/2022/10/file1.pdf) When i send the email, the file is attached correctly but if i add some [documento] the file are not attached.
I have all the latest plugin and wordpress.
Regards.
- The topic ‘file attachment not works with custom field’ is closed to new replies.