Upload Form Options

Options

The easiest way to use the upload form of WordPress File Upload plugin is to put the shortcode [wordpress_file_upload] in the page. In this case, the plugin will use the default functionality.

For configuring the upload form, use the Shortcode Composer, as shown in this guide. The Shortcode Composer works for both shortcodes of the plugin, the upload form and the file list.

The following table contains all Shortcode Composer options of the upload form, together with usage instructions. The corresponding shortcode attribute for each option is also included in blue small letters below the option name.

General Attributes
Basic Functionalities
Upload ID
uploadid
This is the ID of every instance of the plugin inside the same page. Valid values are 1,2,3… Please use a different value for every instance.
Single Button Operation
singlebutton
If set to “true”, only Upload Button will be shown and file will be automatically uploaded when selected. Default value is “false”.
Multiple Files UploadPro
multiple
If set to “true”, multiple files can be selected and uploaded at the same time. Default value is “true”.
Drag and Drop FilesPro
dragdrop
If set to “true”, files can be added to the upload list by drag and drop. Default value is “true”.
Upload Path
uploadpath
This is the path of the upload directory. The path must be relative to wp-content folder of your WordPress website. For instance, if your upload directory is “wp-content/uploads/myuploaddir”, then uploadpath must have the value “uploads/myuploaddir”. The default value is “uploads”, meaning that the files will be uploaded to wp-content/uploads dir. If you want to upload files outside wp-content folder, then put a double dot (..) at the beginning of your uploadpath value. If you put the variable “%username%” inside the uploadpath string, then this variable will be dynamically replaced by the username of the user currently logged in. Other variables are supported as well. Please check the Variables section for details.
Plugin Fit Mode
fitmode
It defines how the plugin’s elements will fit inside the page. If “fixed” is set then the plugin’s elements will always keep their positions unchanged. If “responsive” is set then the plugin’s elements positions will adjust to fit inside container page/post. Default value is “fixed”.
Allow No File
allownofile
If set to “true”, the user can submit the upload form even if a file is not selected. Default value is “false”.
Reset Form Mode
resetmode
It defines whether the form will be reset after upload; “always” means that it will be reset in any case, “onsuccess” means that it will be reset only if upload was successful, “never” means that it will never be reset. Default value is “always”.
Reset on Partial SuccessPro
resetonpartial
It defines whether the form will be reset after a partially successful upload (some files failed to upload). Default value is “true”.
Include CaptchaPro
captcha
If set to “true”, the user will be prompted to complete a captcha (Google ReCaptcha) before uploading the files. Default value is “false”.
Captcha TypePro
captchatype
It defines the type of captcha that will be used. For the moment, Google Recaptcha versions 1 and 2 are supported. Default is Google Recaptcha version 2. If you want to use Google Recaptcha version 2 and you do not have a Google account, then select RecaptchaV2 (no account).
Captcha OptionsPro
captchaoptions
It defines any options about the appearance of captcha, such as theme, size, lang etc. It has the following format: option1 = “value1”, option2 = “value2”, … You can find details about the available options (such as theme, size etc.) from Google Recaptcha’s website.
Filters
Upload Roles
uploadrole
It defines the categories (roles) of users allowed to upload files. Multiple selections can be made, separated by comma(,). If ‘all’ is set, then all logged users can upload files. If ‘guests’ is set, then guests (not logged users) can also upload files. Default value is ‘all,guests’.
Upload UsersPro
uploaduser
It defines the users allowed to upload files. Multiple selections can be made, separated by comma(,). If ‘all’ is set, all logged users can upload files. If ‘guests’ is set, then guests (not logged users) can also upload files. Default value is ‘all,guests’.
Allowed File Extensions
uploadpatterns
This is the filter of the uploaded files. Default value is “*.*”, meaning that all files can be uploaded. Use this attribute to restrict the types of files that can be uploaded. For instance, in order to upload only pdf files put “*.pdf”. You can use more that one filters, separated by comma, for instance “*.pdf,*.doc”.
Allowed File Size
maxsize
This is the maximum size in MBytes of the uploaded files. Use this attribute to restrict the upload of files larger that this value. Default value is “10”, meaning that you cannot upload files larger than 10MBytes.
Upload Path and Files
Create Upload Path
createpath
If set to “true”, the upload directory, defined by uploadpath, will be created in case it does not exist. Default value is “false”.
Do Not Change Filename
forcefilename
The plugin by default will modify the filename if it contains invalid or non-english characters. If set to “true” the plugin will not change the filename. Default value is “false”.
Folder Access Method
accessmethod
It defines the method to create directories and upload files. Default value is “normal”. If it is set to “ftp”, then the plugin will attempt to create directories and upload files using ftp access. In order to do this, the attribute ftpinfo must also be filled with valid ftp access information. Use this attribute when you cannot upload files, access uploaded files or cannot copy or delete uploaded files because of SAFE MODE restrictions, or because the owner of the file is the domain administrator.
FTP Access Credentials
ftpinfo
It defines the ftp access information. It has the syntax username:password@domain:port. If username, password or domain contains the characters (:) or (@), then replace them with (\\:) and (\\@) in order to avoid misreading of the attribute. If you put the character ‘s’ before the port number, then secure ftp (sftp) protocol will be used e.g. myname:mypass@ftpdomain.com:s22
Use FTP Domain
useftpdomain
It is used when the ftp domain used to upload files is in different domain than WordPress installation. If it is set to “true” (and also uploadmethod is “ftp”), then the domain that will be used to upload files will be the one defined in ftpinfo attribute. Default value is “false”.
FTP Passive Mode
ftppassivemode
If set to “true”, FTP passive mode will be used instead of active mode. It is used if files fail to upload when using FTP method. Default value is “false”.
Permissions of Uploaded File
ftpfilepermissions
Force the uploaded files to have specific permissions. This is a 4-digit octal number, e.g. 0777. If left empty, then the ftp server will define the permissions. Default value is “”.
Show Upload Folder Path
showtargetfolder
It defines if the upload directory will be shown to the user. Default value is “false”.
Select Subfolder
askforsubfolders
It defines if the user can select a subfolder to upload the file. Default value is “false”. If set to “true”, then the user is able to select a subfolder of the path, defined by the attribute uploadpath, to upload a file through a drop down list. This attribute is used together with attribute subfoldertree, which defines the subfolders.
List of Subfolders
subfoldertree
It defines the structure of the subfolders that the user can select to upload a file. Default value is “”. The format of this attribute is as follows: the subfolders are separated by commas (,), e.g. “subfolder1, subfolder2”. It is possible to use nested subfolders (a folder inside another folder). To do this place stars (*) before the name of the subfolder. The number of stars determines nesting level, e.g. “subfolder1, *nested1, *nested2, **nested3”. Please note that the first subfolder must be the name of the folder defined by attribute uploadpath (only the last part) without any stars, while all the next subfolders must have at least one star. The user has also the capability to use a different name (from the actual subfolder name) to be shown in the drop down list for every subfolder, by separating the actual and shown name using the slash (/) symbol, e.g.

subfolder1,*subfolder2/shownname2,*subfolder3/shownname3

For defining a default value that will be preselected use the (&) symbol before the item name (but after the starts, e.g. **&nested3.

File Duplicates Policy
duplicatespolicy
It defines what to do when the upload file has the same name with another file inside target directory. If it is set to “overwrite” then the upload file will replace the existing file. If it is set to “reject” then the upload operation will be cancelled. If it is set to “maintain both” then the upload file will be saved inside the target directory with another name, in order to keep both files. Default value is “overwrite”.
File Rename Rule
uniquepattern
It defines how to save the upload file when a file with the same name already exists inside the target directory. If it is set to “index” then the upload file will be saved with a numeric suffix, like (1), (2) etc. in order to keep the name of the uploaded file unique. If it is set to “datetimestamp”, then the suffix will be an encoded datetime of the upload operation. The plugin ensures that the name of the uploaded file will be unique, in order to avoid accidental replacement of existing files. Default value is “index”.
Upload Big Files in ChunksPro
chunk
This option uses chunked upload technique (like Google Drive and Dropbox) to allow the upload of very large files (>1GB) quickly by cutting them in pieces, thus overcoming time and size limitations imposed by the web server or the host. It is disabled by default.
Redirection
Redirect after Upload
redirect
It defines if the user will be redirected to another web page when the file is uploaded successfully. Default value is “false”.
Redirection URL
redirectlink
It defines the url of the redirection page. Please use the prefix “http://” if the redirection page is in another domain, otherwise the server will assume that the url is relative to the server path.
Other Administrator Options
Show Detailed Admin Messages
adminmessages
It offers the option to administrator users to receive additional information about upload errors. These messages will be visible only to administrators. Default value is “false”.
Disable AJAX
forceclassic
It defines if the plugin will use the old classic functionality to upload files (using forms) or ajax functionality (supported in HTML5). Default value is “false”. Please note that if your browser does not support HTML ajax functionality, then the plugin will automatically switch to classic one.
Test Mode
testmode
It defines if the plugin will be shown in test mode. Default value is “false”. If it is set to “true”, then the plugin will obtain a “dummy” functionality (it will not be able to upload files) and it will appear showing all of its objects (the selection of subfolders, progress bar, a test message), while the buttons will show a “Test Mode” message when pressed. This option can be used to configure the dimensions of the individual objects of the plugin more easily.
Debug Mode
debugmode
It defines if the plugin will show debug information. Default value is “false”. If it is set to “true”, then the plugin will show in the message box any warnings and errors generated by PHP during the upload process. It can be used by administrators for deep debugging. For generation of PHP warnings and errors, global WordPress WP_DEBUG constant must be enabled.
Placements
Plugin Component Positions
Plugin Component Positions
placements
It can be used to change the placement of the objects of the plugin. Default value is:

title/filename+selectbutton+uploadbutton/subfolders/captcha/filelist/message

Every line is separated by a slash (/). To put more than one objects to the same line, separate them with a plus (+). Available items are the following: title (a title for the upload plugin), filename (a textbox showing the file selected), selectbutton (button for selecting the files from your computer), uploadbutton (button to upload the selected files), captcha (a security check using captcha), subfolders (allow the use to select the upload subfolder), filelist (show a filelist of the selected files, together with individual progress bars as well as a total progress bar), progressbar (show a total progress bar), userdata (show user fields), message (show message about upload results). You can have more than one instances of userdata inside placements.

Labels
Title
Plugin Title
uploadtitle
The title of the plugin. Default value is “Upload a file”.
Buttons
Select Button Caption
selectbutton
The title of the select button. Default value is “Select File”. In case of multiple file uploads (Professional version) the plural form can also be defined. In this case the default value is “Select File/Select Files”.
Upload Button Caption
uploadbutton
The title of the upload button. Default value is “Upload File”. In case of multiple file uploads (Professional version) the plural form can also be defined. In this case the default value is “Upload File/Upload Files”.
Upload Folder
Upload Folder Label
targetfolderlabel
It defines the text for the message for the upload directory. Default value is “Upload Directory”.
Select Subfolder Label
subfolderlabel
It defines the the label of the subfolders dropdown list. Default value is “Select Subfolder”.
Captcha Parameters
Captcha Prompt LabelPro
captchaprompt
It defines the caption of the captcha text box. Default value is “Please fill in the above words: “.
Upload Messages
Success Upload Message
successmessage
It defines the message to be shown upon successful upload. Default value is “File %filename% uploaded successfully”. You can use the variables %filename% and %filepath% inside the message, as explained in Variables section.
Warning Upload Message
warningmessage
It defines the message to be shown upon successful upload but with warnings. Default value is “File %filename% uploaded successfully but with warnings”. You can use the variables %filename% and %filepath% inside the message, as explained in Variables section.
Error Upload Message
errormessage
It defines the message to be shown upon upload failure. Default value is “File %filename% not uploaded”. You can use the variables %filename% and %filepath% inside the message, as explained in Variables section.
Wait Upload Message
waitmessage
It defines the message to be shown while file uploading. Default value is “File %filename% is being uploaded”. You can use the variables %filename% and %filepath% inside the message, as explained in Variables section.
Webcam Messages
Upload Media Button Caption
uploadmediabutton
It defines the caption of the button that starts the upload when media capture from the webcam has been activated.
Video Filename
videoname
It defines the default file name of the captured video file.
Image Filename
imagename
It defines the default file name of the captured image file.
Other Messages
Required Fields Suffix
requiredlabel
It defines the keyword that shows up next to user field labels in order to denote that they are required.
Notifications
Email Notifications
Notify by Email
notify
If set to “true”, then an email will be sent to the addresses defined by the attribute notifyrecipients to inform them that a new file has been uploaded.
Email Recipients
notifyrecipients
It defines the list of email addresses to receive the notification message that a new file has been uploaded. More that one address can be defined, separated by comma (,). You can use variables inside this attribute, as explained in Variables section.
Email Headers
notifyheaders
It defines additional headers to be included in the notification email (e.g. set “From”, “Cc” and “Bcc” parameters or use HTML code instead of text). Default value is “”. For example, in order to send HTML email please set this attribute to “Content-type: text/html”.
Email Subject
notifysubject
It defines the subject for the notification message. Default value is “File Upload Notification”. You can use variables inside this attribute, as explained in Variables section.
Email Body
notifymessage
It defines the body text for the notification message. Default value is “Dear Recipient, this is an automatic delivery message to notify you that a new file has been uploaded. Best Regards”. You can use variables inside this attribute, as explained in Variables section.
Attach Uploaded Files
attachfile
It defines if the uploaded files will be attached to the notification email. Default value is “false”.
Personal Data
General Personal Data Options
Ask for Consent
askconsent
If activated, then consent from users will be asked for storing their personal data. If users do not give consent, then their data will not be stored in the database, they will only be included in the notification email, if email notifications are active.
Personal Data Types
personaldatatypes
Determines which data are considered as personal data. By default only userdata are considered as personal data. If the 2nd option is selected, then files will also be considered as personal data. This means that if the users do not give their consent, then the files will not be uploaded on the website, they will only be inluded in the notification email as attachments, if email notifications are active.
Consent Behaviour
Do Not Remember Consent Answer
notrememberconsent
If activated the plugin will not remember the consent answer provided by the user and the consent question will always show.
Consent Denial Rejects Upload
consentrejectupload
If activated and user has denied consent then the upload will be rejected. If deactivated, then the upload will continue regardless of consent answer.
Reject Message
consentrejectmessage
Determines the message that will appear to the user if upload cannot continue due to consent denial.
Consent Appearance
Consent Format
consentformat
Determines how consent question will appear to the user. If ‘checkbox’ is selected then a checkbox will appear inside the upload form which the user needs to tick. If ‘radio’ is selected then a radio button with ‘Yes’ and ‘No’ answers will appear inside the form (this makes sure that the user will select something after all. If ‘prompt’ is selected then a dialog will appear on the user when pressing the upload button asking for consent.
Preselected Answer
consentpreselect
Determines whether a default answer will be selected.
Consent Question for Checkbox
consentquestion
Defines the question that will appear to the user next to the checkbox, or radio buttons or inside the prompt dialog. If a word starting and ending with semicolon (:) is added in the question, e.g. :link:, then it will be replaced by a link defined in ‘Consent Disclaimer Link’ attribute. This way a link to a disclaimer can be added.
Consent Disclaimer Link
consentdisclaimer
Defines a link that displays a disclaimer to the user if the user presses the relevant link that is included inside the consent question.
Colors
Upload Message Colors
Success Message Colors
successmessagecolors
It defines the colors of the message shown upon successfull upload. Default value is “#006600,#EEFFEE,#006666”. The first value is the text color, the second the background color and the third the border color.
Warning Message Colors
warningmessagecolors
It defines the colors of the message shown upon successful upload but with warnings. Default value is “#F88017,#FEF2E7,#633309”. The first value is the text color, the second the background color and the third the border color.
Fail Message Colors
failmessagecolors
It defines the colors of the message shown upon upload failure. Default value is “#660000,#FFEEEE,#666600”. The first value is the text color, the second the background color and the third the border color.
Dimension
Plugin Component Widths
Plugin Component Widths
widths
It can be used to define the width of every individual object of the plugin. Default value is “”. To define the width of an individual object, simply put the name of the object and the width, separated by the (:) character (e.g. “title:100px”). To define more than one objects separate them with comma (,).
Plugin Component Heights
Plugin Component Heights
heights
It can be used to define the height of every individual object of the plugin. Default value is “”. To define the height of an individual object, simply put the name of the object and the height, separated by the (:) character (e.g. “title:20px”). To define more than one objects separate them with comma (,).
Additional Fields
Additional Data Fields
Include Additional Data Fields
userdata
It defines if additional text information will be requested by the user. If set to “true”, then an additional textbox will appear, prompting the user to put text data. These data will be sent to email recipients, if email notification has been activated and %userdata% variable exists inside notifymessage attribute. Default value is “false”.
Additional Data Fields
userdatalabel
It defines the labels of the userdata fields. Separate each field with slash “/”. The most simple is to define the field’s label (text field will be assumed), e.g. Name/Email will define two text fields, one with label “Name” and one with label “Email”. Additional options can be defined for each field, appended after the label using a “|” separator, an option designator (a single character plus “:” sign) and an option value. Details about the field types, their options and syntax are contained in this article.
Interoperability
Connection With Other Plugins
WP Filebase Plugin Connection
filebaselink
It defines if this plugin will be linked to wp-filebase plugin. Wp-filebase is another plugin with which you can upload files and then show them in your pages in a customizable way. If you set this attribute to “true”, then you can upload files inside wp-filebase directories using wordpress_file_upload and then update the databases of wp-filebase, so that it is informed about the new uploads. The default value is “false”. Please note that this attribute does not check to see if wp-filebase is installed and active, so be sure to have wp-filebase active if you want to use it.
Add Uploaded Files to NextGEN GalleryPro
nextgen
If enabled then the uploaded files will be added to a NextGEN Gallery. Default is false.
NGG Gallery IDPro
ngg_galleryid
It defines the ID of the NextGEN Gallery where uploaded files will be added. Default is 1.
NGG File DescriptionPro
ngg_description
It defines the description of the file added to NextGEN Gallery.
NGG File Alt TextPro
ngg_alttext
It defines the alt/title text of the file added to NextGEN Gallery.
NGG File TagsPro
ngg_tags
It defines a comma-separated list of tags for the file added to NextGEN Gallery.
NGG Exclude FilePro
ngg_exclude
It defines whether the added file in NextGEN Gallery will have its ‘Exclude’ property active. If it is active then the file will not be shown in Gallery until the admin deactivates it from Dashboard. Default is false.
Connection With Other WordPress Features
Add Uploaded Files To Media
medialink
It defines if the uploaded files will be added to the Media of the WordPress website. The default value is “false”. Please note that the files must be uploaded inside uploads folder of the wp-content directory (this is the default value of the uploadpath attribute) in order to be shown in Media.
Attach Uploaded Files To Post
postlink
It defines if the uploaded files will be linked with the current page as attachments. The default value is “false”. Please note that the files must be uploaded inside uploads folder of the wp-content directory (this is the default value of the uploadpath attribute) in order to be attached correctly. If this attribute is activated, then files will be added to Media as well.
Show Image Gallery Below PluginPro
gallery
If enabled then an image gallery will be shown below the plugin, showing all images attached to the page. If you want an uploaded image to be shown in the gallery upon upload, then use postlink=”true” to attach it to the page and forceclassic=”true” in order to force the page to reload every time a file is uploaded (so that the gallery is refreshed). Default value is false.
Image Gallery OptionsPro
galleryoptions
It defines gallery options in the form option1=”value1″ option2=”value2″. For details about the available options please visit http://codex.wordpress.org/Gallery_Shortcode.
Connection With Cloud Services
Upload To Microsoft OneDrivePro
onedrive
If enabled then the uploaded files will be transferred to the Microsoft OneDrive account that has been configured in the plugin’s settings. Default is false.
OneDrive PathPro
onedrivepath
It defines the path inside the Microsoft OneDrive account that the uploaded file will be transferred. If the path does not exist it will be created. This attribute accepts variables, just like the uploadpath attribute. Default value is empty (root folder of Microsoft OneDrive account).
Include UserdataPro
onedriveuserdata
If it is enabled then the uploaded file’s userdata will be included in the transferred Microsoft OneDrive file description.
Local File ActionPro
onedrivelocal
It defines whether to keep or delete the local file stored in the website, after it has been transferred to the Microsoft OneDrive account. It can take the value “keep” or “delete”. Default value is “keep”.
Conflict PolicyPro
onedriveconflict
It defines what happens if a file with the same name already exists at Microsoft OneDrive destination. It can either fail, or replace the existing file or be renamed. Default value is “rename”.
Upload To DropboxPro
dropbox
If enabled then the uploaded files will be transferred to the Dropbox account that has been configured in the plugin’s settings. Default is false.
Dropbox PathPro
dropboxpath
It defines the path inside the Dropbox account that the uploaded file will be transferred. If the path does not exist it will be created. This attribute accepts variables, just like the uploadpath attribute. Default value is empty (root folder of Dropbox account).
Local File ActionPro
dropboxlocal
It defines whether to keep or delete the local file stored in the website, after it has been transferred to the Dropbox account. It can take the value “keep” or “delete”. Default value is “keep”.
Upload To Google DrivePro
gdrive
If enabled then the uploaded files will be transferred to the Google Drive account that has been configured in the plugin’s settings. Default is false.
Google Drive PathPro
gdrivepath
It defines the path inside the Google Drive account that the uploaded file will be transferred. If the path does not exist it will be created. This attribute accepts variables, just like the uploadpath attribute. Default value is empty (root folder of Google Drive account).
Include UserdataPro
gdriveuserdata
If it is enabled then the uploaded file’s userdata will be included in the transferred Google Drive file description.
Local File ActionPro
gdrivelocal
It defines whether to keep or delete the local file stored in the website, after it has been transferred to the Google Drive account. It can take the value “keep” or “delete”. Default value is “keep”.
Trash DuplicatesPro
gdriveduplicates
If it is enabled then any files with identical names in Google Drive destination folder will be trashed. Default value is false.
Webcam
Capture from Webcam (experimental)
Enable Webcam
webcam
It enables capturing of video or still pictures from the computer’s webcam. It is experimental because it is not supported by all browsers yet.
Capture Mode
webcammode
It defines the webcam capture mode. The webcam can either capture video, still photos or both.
Capture Audio
audiocapture
It defines whether audio will be captured together with video from the webcam.
Video Width
videowidth
It requests a preferable video width for the webcam. The plugin will try to match this setting as close as possible depending on webcam capabilities.
Video Height
videoheight
It requests a preferable video height for the webcam. The plugin will try to match this setting as close as possible depending on webcam capabilities.
Video Aspect Ratio
videoaspectratio
It requests a preferable video aspect ratio for the webcam. The plugin will try to match this setting as close as possible depending on webcam capabilities.
Video Frame Rate
videoframerate
It requests a preferable video frame rate for video recording. The plugin will try to match this setting as close as possible depending on webcam capabilities.
Camera Facing Mode
camerafacing
It defines if the front or back camera will be preferred (for mobile devices with 2 cameras). The plugin will try to match this setting depending on webcam capabilities.
Max Record Time
maxrecordtime
It defines the maximum time of video recording (in seconds). If it is set to -1, then there is no time limit.
Custom CSS
Advanced Customization of Appearance
Custom CSS EditorPro
css
It defines custom css to style the elements of the plugin in a more advanced way. A delicate css editor is included inside Shortcode Composer.

Examples

You can use any of these attributes to customize the plugin. The way to use these attributes is the following:

[wordpress_file_upload attribute1=value1 attribute2=value2]

Here are some examples:

[wordpress_file_upload uploadtitle="Upload files to the Upload dir"]
[wordpress_file_upload uploadtitle="Upload files to the Upload dir" uploadpath="uploads/myuploaddir"]
[wordpress_file_upload uploadid="1" uploadpath="../myuploaddir"]
[wordpress_file_upload uploadpath="uploads/users/%username%" createpath="true"]
[wordpress_file_upload uploadpath="uploads/myuploaddir" notify="true" notifyrecipients="name1@address1.com, name2@address2.com"]
[wordpress_file_upload uploadpath="/uploads/myuploaddir" askforsubfolders="true" subfoldertree="myuploaddir/My Upload Directory,*subfolder1/Subfolder1 Inside myuploaddir,**inner/2nd Level Nested Dir, *reports/Reports"]
[wordpress_file_upload uploadrole="all" uploadpath="/uploads/filebase/%username%" createpath="false" notify="true" notifyrecipients="myname@domain.com" notifysubject="A new file has been uploaded!" attachfile="true" askforsubfolders="true" subfoldertree="admin/Administrator,*root/Root Folder,**inner, *reports/Reports" filebaselink="true" widths="filename:150px, selectbutton:80px, uploadbutton:80px, progressbar:220px, message:368px, subfolders_label:100px, subfolders_select:125px" placements="title/filename+subfolders/selectbutton+uploadbutton+progressbar/message"]
[wordpress_file_upload uploadpath="uploads/myuploaddir" notify="true" notifyrecipients="name1@address1.com, name2@address2.com" notifymessage="File %filename% has been received, together with fields Name:%userdata0%, Email:%userdata1%" userdata="true" userdatalabel="Name/*Email (required)"][wordpress_file_upload uploadpath="uploads/myuploaddir" notify="true" notifyrecipients="name1@address1.com, name2@address2.com" notifymessage="This is a test HTML message body.<br/><br/>This word is <em>italic</em> and this is <strong>bold</strong>." notifyheaders="Content-type: text/html"]

Variables

From version 1.2 variables are supported inside attributes.

A variable is a string surrounded by percent characters, in the form %variable_name%. This variable is replaced by another string whenever the plugin is executed.

For instance, if the variable %username% is used inside uploadpath attribute, then it will be replaced by the username of the user who is currently logged in every time a file is uploaded. By this way, every user can upload files to a separate folder, without any additional programming.

For the time being, the following attributes are supported:

  • %userid%: Is replaced by the id of the current user. Can be used inside attributes uploadpath and dropboxpath.
  • %username%: Is replaced by the username of the current user. Can be used inside attributes uploadpath, notifysubject, notifymessage, redirectlink and dropboxpath.
  • %useremail%: Is replaced by the email of the current user. Can be used inside attributes notifyrecipients, notifysubject and notifymessage.
  • %filename%: Is replaced by the filename (not including path information) of the uploaded file. Can be used inside attributes notifysubject, notifymessage, successmessage and redirectlink.
  • %filepath%: Is replaced by the filepath (full path and filename) of the uploaded file. Can be used inside attributes notifysubject, notifymessage and successmessage.
  • %blogid%: Is replaced by the blog_id of the current site. Can be used inside attribute uploadpath, notifysubject, notifymessage and dropboxpath.
  • %userdataXXX%: Is replaced by the additional message that the user has sent together with the file upload. XXX is the number of the field (starting from 0). The shortcode attribute userdata must have been set to “true”. Can be used inside attributes uploadpath, notifysubject, notifymessage and dropboxpath.
  • %n%: Denotes change of line (equivalent of \n). Can be used inside attribute notifymessage. It exists because of problems of using \n inside the classic page editor of WordPress.
  • %pagetitle%: Is replaced by the title of the current page. Can be used inside attribute uploadpath, notifysubject, notifymessage and dropboxpath.
  • %pageid%: Is replaced by the id of the current page. Can be used inside attribute uploadpath, notifysubject, notifymessage and dropboxpath.

In addition, some special variables, which are used to replace literals not allowed in shortcodes (such as double quotes or brackets), are also supported. They can be used in attributes that receive free text (like button labels, email notification body etc.). These special variables are:

  • %n%: When used inside an attribute (e.g. inside notifymessage) it will be replaced by a change-of-line character (\n).
  • %dq%: When used inside an attribute it will be replaced by a double quote (“).
  • %brl%: When used inside an attribute it will be replaced by an opening bracket ([).
  • %brr%: When used inside an attribute it will be replaced by a closing bracket (]).