Uploaded files
Map a Gravity Forms File Upload field to a CAFE Image, File or Gallery field in the CAFE feed. When the feed runs, each uploaded file is copied into the WordPress media library and the CAFE field gets the new attachment.
| CAFE field | Gets |
|---|---|
| Image | The first uploaded image |
| File | The first uploaded file |
| Gallery | Every file of a File Upload field with "Enable Multi-File Upload" |
What happens to the files
- A new post or the Post fields' post becomes the parent of the attachment, so it shows under "Uploaded to this post" in the media library.
- The person who sent the form owns the attachment (visitors: no owner).
- The entry keeps its own file. Deleting the entry does not delete the copy in the media library.
- Processing an entry again reuses the copies made the first time.
- When anything fails, for example an invalid value in another field, the copies made for this save are deleted again, so no stray files stay behind.
Which files are accepted
- The rules of the CAFE field still apply: an Image field only accepts images, and the field's allowed file types are checked.
- Only file types WordPress allows are copied, never PHP or other scripts.
- Files are only read from this site's uploads folder, where Gravity Forms stores them. Other websites are never contacted.
- Limit the file size in the Gravity Forms File Upload field (Maximum File Size) and the allowed extensions there (Allowed file extensions).
Tips
- Use the same allowed file types in Gravity Forms as in the CAFE field, so visitors get a clear message on the form instead of a feed error later.
- Keep Gravity Forms uploads in the normal uploads folder. When the upload
path is moved outside
wp-content/uploads(with thegform_upload_pathfilter), CAFE refuses the files.