Title: Conditionally attach file from field
Last modified: August 22, 2016

---

# Conditionally attach file from field

 *  [rjaeckel](https://wordpress.org/support/users/rjaeckel/)
 * (@rjaeckel)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/conditionally-attach-file-from-field/)
 * Hi there,
 * i’ve already read the relating code so i would say this is not possible at the
   moment:
 * I’m trying to use `[select fname ... "foo|/file/to/attach"]`
 * in the mail block i put `[fname]` into the attachments field. But the file won’t
   be accepted as it is a field.
 * There are currently just two options to attach a file:
    1. create a file field and put its value into the attachment field
    2. pass an exisiting filename to the attachment area
 * Any idea how to make this possible? I know it’s some kind of security issue if
   variables could be used. but it could be an option to allow this only in the `
   wwp_upload_dir()[base]`.
 * [https://wordpress.org/plugins/contact-form-7-to-database-extension/](https://wordpress.org/plugins/contact-form-7-to-database-extension/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/conditionally-attach-file-from-field/#post-5322508)
 * This sounds like a question for the Contact Form 7 forum.
 *  Thread Starter [rjaeckel](https://wordpress.org/support/users/rjaeckel/)
 * (@rjaeckel)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/conditionally-attach-file-from-field/#post-5322610)
 * Sorry for this.
 * Are you able to delete this topic?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Conditionally attach file from field’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/contact-form-7-to-database-extension_ffffff.
   svg)
 * [Contact Form DB](https://wordpress.org/plugins/contact-form-7-to-database-extension/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7-to-database-extension/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/reviews/)

## Tags

 * [attachment](https://wordpress.org/support/topic-tag/attachment/)
 * [field](https://wordpress.org/support/topic-tag/field/)
 * [pipe](https://wordpress.org/support/topic-tag/pipe/)
 * [variable](https://wordpress.org/support/topic-tag/variable/)

 * 2 replies
 * 2 participants
 * Last reply from: [rjaeckel](https://wordpress.org/support/users/rjaeckel/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/conditionally-attach-file-from-field/#post-5322610)
 * Status: not a support question