File Uploads

The File Uploads add-on needs to be installed and activated to see the features mentioned in this this documentation.

A File Uploads field can be added to the form by clicking on the Add Field Button on the bottom right, then choosing the File Upload field from the list.
add-field-buttonchoose-the-file-upload-field

Field Settings

Save to Server – If this setting is disabled, the File Upload will not be saved to the server when the form submits.
save-to-server-setting

Rename Uploaded File –
rename-uploaded-file

Renaming Conventions
%filename% – The file’s original filename, with any special characters removed.
%formtitle% – The title of the current form, with any special characters removed.
%username% – The WordPress username for the user, if they are logged in.
%userid% – The WordPress ID (int) for the user, if they are logged in.
%displayname% – The WordPress displayname for the user, if they are logged in.
%lastname% – The WordPress lastname for the user, if they are logged in.
%firstname% – The WordPress firstname for the user, if they are logged in.
%date% – Today’s date in yyyy-mm-dd format.
%month% – Today’s month in mm format.
%day% – Today’s day in dd format.
%year% – Today’s year in yyyy format.
%field_X% where X is the ID of the field you would like to use to rename the file. You can find the ID by viewing the form through the preview and using the Inspect Element on the field you would like to use.  Ex: If the ID is “nf-field-4”, you would use %field_4% .

Save to Media Library – If this setting is enabled, the File Upload will be save to the server’s Media Library.
save-to-media-library-setting

Restrictions Settings
    • File Limit – The amount of files the user is allowed to upload to that field.

file-limit

    • File Size Limit – The size limit of the files for that field

file-size-limit

    • Allowed File Types – The file types that are allow for that field.

allowed-file-types
Comma Separated List of allowed file types. An empty list means all file types are accepted.


Attaching File Uploads to Email

This can be accomplished in two ways, the first method via merge tag, which will then create a link to the file/s uploaded in the received email.

  1. From the Emails and Actions tab, edit the email notification action’s by clicking on the action gear symbol. From here, click the merge tag button located in the Email Message line, shown below. 2. Add in the File Uploads merge tag to the Email Message body by simply clicking on it. Should your list show many merge tags, and you have trouble locating the correct tag, feel free to take advantage of the merge tag search bar and type File Uploads to locate the appropriate tag.

The second method (below) will attach the file itself to the email.

  1. From the Emails and Actions tab, edit the email notification action’s by clicking on the action gear symbol.
  2. From the pull out drawer, scroll down to the Advanced tab and click to drop down.
  3. Then activate (click) the Attach File Uploads toggle.


Save the File Upload to an External Service

Connecting Ninja Forms to Dropbox
To connect Ninja Forms to Dropbox, go to Forms > File Uploads > External Settings tab and click on the Connect button
connect-to-dropbox

The File Path can be used to setup a Custom directory for the files to be uploaded to your /Apps/Ninja Forms Uploads/ folder in Dropbox.

Connecting Ninja Forms to Amazon S3
  1. Open the IAM console.
  2. In the navigation pane, choose Users. Then choose your IAM user name.
  3. Choose the Security Credentials tab and then choose Create Access Key.
  4. To see your access key, choose Show User Security Credentials.
    Your credentials will look something like this:
    Access Key ID: AKIAIOSFODNN7EXAMPLE
    Secret Access Key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
  5. Choose Download Credentials, and store the keys in a secure location.
  6. Go to Forms > File Uploads > External Settings tab and enter your Access Key ID and Secret Access Key

To save the File Upload to an External Service, you can add an External File Upload Action to your form.

For the Action to show, you will need to connect to Dropbox or Amazon first by going to Ninja Forms > File Uploads > External Settings
external-fiel-upload

Under the External File Upload Action, you can choose the service you would like the files from your form to save to.
choose-external-service


File Uploads Plugin Settings (Forms > File Uploads)

Browser Uploads tab – It shows a sortable list of the files uploaded through your server.

Upload Settings Tab
upload-settings

  • Max File Size (in MB) – The Max File Upload size allowed per form.
  • File upload error message – The Error Message that the user receives when the Max File Size is met.
  • Custom Directory – Is used to create dynamic directories.
Accepted Shortcodes
  • %filename% – Puts in the title of the current form without any spaces
  • %formtitle% – Puts in the title of the current form without any spaces
  • %date% – Puts in the date in yyyy-mm-dd (1998-05-23) format
  • %month% – Puts in the month in mm (04) format
  • %day% – Puts in the day in dd (20) format
  • %year% – Puts in the year in yyyy (2011) format
  • %username% – Puts in the user’s username if they are logged in
  • %userid% – Puts in the user’s user ID if they are logged in
  • %displayname% – Puts in the user’s display name if they are logged in
  • %firstname% – Puts in the user’s first name if they are logged in
  • %lastname% – Puts in the user’s last name if they are logged in
  • %random% – Puts in a random 5 character string
  • %field_x% – Another field in your form, where x is the field key.

If you migrate from another server and the File Uploads path is pointing to the older server location, you can deactivate then reactivate your File Uploads and Ninja Forms plugins to reset the file path.

How helpful was this documentation?

Gold Star Green Light Yellow Light Red Light
Very helpful Helpful Unclear/Unhelpful Not helpful at all