WordPress File Upload is a WordPress plugin. It is the successor of Inline Upload plugin.
With this plugin you, or other users, can upload files to your WordPress website from any page by using shortcodes.
The plugins comes in two versions, professional and free. The professional version contains some additional features as described in detail below.
A screenshot of the plugin in its most simple form is shown below.
Simply put the shortcode [wordpress_file_upload] to the contents of any WordPress page and you will be able to upload files to any directory inside wp-contents of your WordPress site.
The characteristics of the plugin are:
- It does not use flash and handles uploads using various technologies (HTML5, AJAX, classic HTML forms) depending on browser’s capabilities, which detects automatically. As a result it can work in any browser, including mobiles phones (even old ones).
- You can have more than one instances of the shortcode in the same page.
- It supports multiple file uploads (Professional version).
- It supports drag and drop of files (Professional version).
- It can upload files of any size, regardless of web server restrictions (Professional version).
- It includes an overall upload progress bar.
- It includes details and progress bars for each file individually (Professional version).
- It includes captcha for checking user before file upload (Professional version).
- It supports localization.
- It integrates with WP-Filebase.
- It is highly customizable with many options.
- It produces notification messages and e-mails.
- You can create additional fields that the user must fill in along with the uploaded file.
- It supports redirection to another url after successful upload.
- You can create you shortcode very easily by using the included Shortcode Composer in the plugin’s settings inside Dashboard.
Please note that old desktop browsers or mobile browsers may not support all of the above features. In order to get full functionality use the latest versions of browsers, supporting HTML5, AJAX and CSS3.
- First copy wordpress_file_upload directory inside wp-contents/plugins directory of your wordpress site.
- Activate the plugin from Plugins menu of your Dashboard.
- In order to use the plugin simply put the shortcode [wordpress_file_upload] in the contents of any page.
- If you want more options, go to plugin Settings inside Dashboard, open Shortcode Composer and select the options you want. The composer generates the shortcode automatically. Copy and paste it to the page of your choice.
You can download the free version of the plugin by pressing the FREE version button below, or you can go for the professional version that offers multiple file uploads, captcha and much more by pressing the PRO version button.
The easiest way to use the plugin is to put the shortcode [wordpress_file_upload] in the page. In this case, the plugin will use the default functionality.
If you want to customize the plugin (define the upload path, use file filter, change title and button text etc.) then you can use attributes. Go to Dashboard / Settings / WordPress File Upload and then press Shortcode Composer. By selecting the attributes of your choice, the shortcode will be automatically generated. Then you can copy and paste it in any page.
A detailed list of attributes, together with instructions is shown below:
|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.|
|singlebutton||If set to “true”, only Upload Button will be shown and file will be automatically uploaded when selected. Default value is “false”.|
|multiplePro||If set to “true”, multiple files can be selected and upload at the same time. Default value is “true”.|
|dragdropPro||If set to “true”, files can be added to the upload list by drag and drop. Default value is “true”.|
|captchaPro||If set to “true”, the user will be prompted to complete a captcha (Google ReCaptcha) before uploading the files. Default value is “false”.|
|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 put the variable “%username%” inside the uploadpath string, then this variable will be replaced by the username of the user currently logged in. If you want to upload files outside wp-content folder, then put a double dot (..) at the beginning of your uploadpath value.|
|uploadrole||This is the role that is allowed to upload files. Default role is “administrator”. If you use another role, like “editor”, then only users of this role and also of role “administrator” will be able to upload files. If you set uploadrole to “all” then all users, even guests, will be able to upload files.|
|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”.|
|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|
|createpath||If set to “true”, the upload directory, defined by uploadpath, will be created in case it does not exist. Default value is “false”.|
|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.|
|ftpinfo||It defines the ftp access information. It has the syntax username:password@domain. If username, password or domain contains the characters (:) or (@), then replace them with (\\:) and (\\@) in order to avoid misreading of the attribute.|
|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”.|
|showtargetfolder||It defines if a message with the upload directory will be shown. Default value is “false”.|
|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.|
|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.
|dublicatespolicy||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”.|
|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”.|
|chunkPro||This option uses Google Drive technique 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.|
|redirect||It defines if the user will be redirected to another web page when the file is uploaded successfully. Default value is “false”.|
|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|
|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”.|
|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.|
|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.|
|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.|
|Plugin Component Positions|
|placements||It can be used to change the placement of the objects of the plugin. Default value is:
Every line is separated by a slash (/). To put more than one objects to the same line, separate them with a plus (+). The name of every object is shown below.
|uploadtitle||The title of the plugin. Default value is “Upload a file”.|
|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”.|
|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”.|
|targetfolderlabel||It defines the text for the message for the upload directory. Default value is “Upload Directory”.|
|captchapromptPro||It defines the caption of the captcha text box. Default value is “Please fill in the above words: “.|
|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 below.|
|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 below.|
|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 below.|
|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 below.|
|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.|
|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 below.|
|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”.|
|notifysubject||It defines the subject for the notification message. Default value is “File Upload Notification”. You can use variables inside this attribute, as explained below.|
|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 below.|
|attachfile||It defines if the uploaded files will be attached to the notification email. Default value is “false”.|
|Upload Message Colors|
|successmessagecolor||It defines the color of the message shown upon successful upload. Default value is “green”. This attribute is no longer used but is maintained for backward compatibility. Please use successmessagecolors instead.|
|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.|
|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.|
|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.|
|waitmessagecolors||It defines the colors of the message shown while file uploading. Default value is “#666666,#EEEEEE,#333333″. The first value is the text color, the second the background color and the third the border color.|
|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|
|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 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”.|
|userdatalabel||It defines the labels of the userdata fields. Separate each field with slash “/”. If you want a field to be required, then preceed an asterisk (*) before the label. Example to create 2 fields, an optional Name and a required Email field: userdatalabel=”Name/*Email (required)”. Default value is “Your message”.|
|Connection With Other Plugins|
|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.|
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="email@example.com, firstname.lastname@example.org"][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="email@example.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="firstname.lastname@example.org, email@example.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="firstname.lastname@example.org, email@example.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"]
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:
- %username%: Is replaced by the username of the current user. Can be used inside attributes uploadpath, notifysubject and notifymessage.
- %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.
- %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 notifysubject, notifymessage.
- %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.
- Several bug fixes and code reconstruction.
- Code modifications so that the plugin can operate even when DEBUG mode is ON.
- New attribute debugmode added to allow better debugging of the plugin when there are errors.
- Correct bugs with captcha and chunked uploads.
- Improve progress bar performance.
- Bug fixes with broken images when WordPress website is in a subdirectory.
- Replacement of glob function because is not allowed by some servers.
- Addition of chunk attribute to enable uploading of very large files.
- Bug fixes in Dashboard Settings Shortcode Composer.
- Correction of important bug that was breaking page in some cases.
- Minor improvements of user data fields and notification email attributes.
- Name of the plugin changed to WordPress File Upload.
- Plugin has been completely restructured to allow additional features.
- A new more advanced message box has been included showing information in a more structured way.
- Error detection and reporting has been improved.
- An administration page has been created in the Dashboard Settings, containing a Shortcode Composer.
- Some more options related to configuration of message showing upload results have been added.
- Several bug fixes.
- Userdata attribute changed to allow the creation of more fields and required ones.
- Spanish translation added thanks to Maria Ramos of WebHostingHub.
- Added notifyheaders attribute, in order to allow better control of notification email sent (e.g. allow to send HTML email).
- Added userdata attribute, in order to allow users to send additional text data along with the uploaded file.
- Added single button operation (file will be automatically uploaded when selected without pressing Upload Button).
- Fixed bug with functionality of attribute filebaselink for new versions of WP-Filebase plugin.
- Fixed problem with functionality of attribute filebaselink for new versions of WP-Filebase plugin.
- More than one roles can now be defined in attribute uploadrole, separated by comma (,).
- Variable %filename% now works also in redirectlink.
- Changes in ftp functionality, added useftpdomain attribute so that it can work with external ftp domains as well.
- Improvement of classic upload (used in IE or when setting forceclassic to true) messaging functionality.
- Minor bug fixes.
- Source modified so that it can work with WordPress sites that are not installed in root.
- Added variable %blogid% for use with multi-site installations.
- Bug fixes related to showing of messages.
- Replacement of json2.js with another version.
- CSS style changes to resolve conflicts with various theme CSS styles.
- Added variable %useremail% used in notifyrecipients, notifysubject and notifymessage attributes.
- Added capability to upload files outside wp-content folder.
- Improved error reporting.
- Complete restructuring of plugin HTML code, in order to make it more configurable and customizable.
- Appearance of messages has been improved.
- Added option to put the plugin in testmode.
- Added option to configure the colors of success and fail messages.
- Added option to modify the dimensions of the individual objects of the plugin.
- Added option to change the placement of the individual objects of the plugin.
- Improved error reporting.
- Added localization for error messages.
- Minor bug fixes.
- Bug fixes to correct incompatibilities of the new ajax functionality when uploadrole is set to “all”.
- Bug fixes to correct incompatibilities of the new ajax functionality with redirectlink, filebaselink and adminmessages.
- Correction of serious bug that prevented the normal operation of the plugin when the browser of the user supports HTML5 functionality.
- Tags added to the plugin WordPress page.
- Major lifting of the whole code.
- Added ajax functionality so that file is uploaded without page reload (works in browsers supporting HTML5).
- Added upload progress bar (works in browsers supporting HTML5).
- Added option to allow user to select if wants to use the old form upload functionality.
- File will not be saved again if user presses the Refresh button (or F5) of the page.
- Translation strings updated.
- Bug fixes for problems when there are more than one instances of the plugin in a single page.
- Added option to notify user about upload directory.
- Added option to allow user to select a subfolder to upload the file.
- Css corrections for bug fixes.
- Added option to attach uploaded file to notification email.
- Added option to customize message on successfull upload (variables %filename% and %filepath% can be used).
- Added option to customize color of message on successfull upload.
- C:fakepath” problem resolved.
- Warning message about function create_directory() resolved.
- Css enhancements for compatibility with more themes.
- Additional variables added (%filename% and %filepath%).
- All variables can be used inside message subject and message text.
- Added option to determine how to treat dublicates (overwrite existing file, leave existing file, leave both).
- Added option to determine how to rename the uploaded file, when another file already exists in the target directory.
- Added option to create directories and upload files using ftp access, in order to overcome file owner and SAFE MODE restrictions.
- Added the capability to redirect to another web page when a file is uploaded successfully.
- Added the option to show to administrators additional messages about upload errors.
- Bug fixes related to interoperability with WP_Filebase.
- Added notification by email when a file is uploaded.
- Added the ability to upload to a variable folder, based on the name of the user currently logged in.
Added the option to allow anyone to upload files, by setting the attribute uploadrole to “all”.
This is the initial release of the plugin.