How Caldera Forms File Attachments Uploads Work

Caldera Forms Banner

Caldera Forms file and advanced file upload fields have three important options that determine how file uploads are handled:

  • Attach To Mailer – Select this option if you wish to attach the file to the mailer.
    • This option, if it is the only option checked, will not cause files to be saved on your server.
  • Allow Multiple – If checked, more than one file can be uploaded through this field
    •  Advanced file fields have a way better interface than basic file fields for this.
  • Add To Media Library – If checked uploaded files will be uploaded to the media library and saved on your server.
    • The magic tag for this field (or summary magic tag) will show a link to the file.
    • Checking this option is the easiest way to have files be saved to your server.

What Happens With Different Settings

  • If you select attach to mailer and not add to media library, then the file is saved to the server, attached to the email and then deleted from the server.
  • If you select attach to mailer and add to media library, then the file is saved to the server, attached to the email and added to the media library.
  • If you select add to media library, then the file is saved to the server, attach to the email and added to the media library.

How To Save Caldera Forms File Fields Without Adding To Media Library

If you want to have files uploaded to your forms be saved on your server, the easy way to do it is to uncheck the Add To Media Library option. However, you can also select the Attach To Mailer option and remove the hooks that delete the files, as shown below:

You could also build your own file upload handler.

How To Change The Path For The Uploaded Files

By default, when uploading files that will be saved, WordPress’ default media library file path will be used. You can change the location within the uploads directory using the caldera_forms_upload_directory filter.

How To Limit Caldera Forms File Field Upload Size

Limit File Upload Size For Caldera Forms File Fields