Title: [Plugin: Gravity Forms   Custom Post Types] Attach arbitrary file type to post?
Last modified: August 20, 2016

---

# [Plugin: Gravity Forms Custom Post Types] Attach arbitrary file type to post?

 *  [Travis Northcutt](https://wordpress.org/support/users/travisnorthcutt/)
 * (@travisnorthcutt)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-custom-post-types-attach-arbitrary-file-type-to-post/)
 * Is it possible, using this plugin, to allow the form submitter to upload a file
   which will then be attached to the newly created post? I’m aware of the “Image”
   post field, but that only allows image files, whereas I want to accept e.g. .
   doc and .pdf files.
 * I tried using the “File Upload” field under the advanced group, but this doesn’t
   seem to attach the file to the newly created post in any way – it just connects
   it to the gravity forms “entry”.
 * Any suggestions?
 * [http://wordpress.org/extend/plugins/gravity-forms-custom-post-types/](http://wordpress.org/extend/plugins/gravity-forms-custom-post-types/)

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

 *  Thread Starter [Travis Northcutt](https://wordpress.org/support/users/travisnorthcutt/)
 * (@travisnorthcutt)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-custom-post-types-attach-arbitrary-file-type-to-post/#post-2950109)
 * It appears I was mistaken – using the file upload field and providing a custom
   field name results in a postmeta entry for the post being created, with the url
   to the uploaded file as the value. I’d still be interested to hear if there’s
   a way to get it to create an attachment, and actually attach the file to the 
   relevant post, but that’s not 100% necessary (for my use case).
 *  Thread Starter [Travis Northcutt](https://wordpress.org/support/users/travisnorthcutt/)
 * (@travisnorthcutt)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-custom-post-types-attach-arbitrary-file-type-to-post/#post-2950208)
 * Sorry to revisit this, but it turns out not having the uploaded file exist as
   an attachment is quite limiting. Since only the URL to the file is stored, there’s
   no clean way to for instance get the size of the file, since that requires knowing
   the full path to the file. This is provided by `get_attached_file()` for WordPress
   attachments, but isn’t available to files uploaded in this manner, since they
   have no ID.
 *  [Israel Curtis](https://wordpress.org/support/users/somatic/)
 * (@somatic)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-custom-post-types-attach-arbitrary-file-type-to-post/#post-2950348)
 * I’m looking for the exact same functionality. I found this support discussion
   
   [http://www.gravityhelp.com/forums/topic/upload-update](http://www.gravityhelp.com/forums/topic/upload-update)
 * but this is from before the 1.6 update, and mentions it *may* be considered for
   the 1.7 update.
 * I’ve heard there are some file-handling hooks available in gravity forms?

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

The topic ‘[Plugin: Gravity Forms Custom Post Types] Attach arbitrary file type 
to post?’ is closed to new replies.

 * ![](https://ps.w.org/gravity-forms-custom-post-types/assets/icon-256x256.png?
   rev=2542252)
 * [Gravity Forms + Custom Post Types](https://wordpress.org/plugins/gravity-forms-custom-post-types/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gravity-forms-custom-post-types/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/)
 * [Active Topics](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/reviews/)

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)
 * [file upload](https://wordpress.org/support/topic-tag/file-upload/)

 * 3 replies
 * 2 participants
 * Last reply from: [Israel Curtis](https://wordpress.org/support/users/somatic/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-custom-post-types-attach-arbitrary-file-type-to-post/#post-2950348)
 * Status: not resolved