=== Inline Upload === Contributors: nickboss Donate link: http://www.iptanus.com/?page_id=27 Tags: upload, upload file Requires at least: 2.9.2 Tested up to: 3.0.1 Stable tag: "trunk" Simple plugin to upload files from any page == Description == With this plugin you can upload files to your site from any page by using shortcodes. Simply put the shortcode [inline_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, so it can work in any browser, even in mobile phones. * You can have more than one instances of the shortcode in the same page. * It supports localization. * It is very small. * It integrates with WP-Filebase. * It is highly customizable. * It produces notification messages. Please visit the **Other Notes** section for customization options of this plugin. == Installation == 1. First copy inline_upload directory inside wp-contents/plugins directory of your wordpress site. 1. Activate the plugin from Plugins menu of your Dashboard. 1. In order to use the plugin simply put the shortcode [inline_upload] in the contents of any page. == Frequently Asked Questions == = Do I need to have Flash to use then plugin? = No, you do not need Flash to use the plugin. = I get an SAFE MODE restriction error when I try to upload a file. Is there an alternative? = Your domain has probably turned SAFE MODE ON and you have restrictions uploading and accessing files. Inline Upload includes an alternative way to upload files, using FTP access. Simply add the attribute **accessmethod="ftp"** inside the shortcode, together with FTP access information in **ftpinfo** attribute. == Screenshots == 1. A screenshot of the plugin is shown below. == Changelog == = 1.3 = * 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 = 1.2 = * 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. = 1.1 = Added the option to allow anyone to upload files, by setting the attribute uploadrole to "all". = 1.0 = Initial version. == Upgrade Notice == = 1.3 = Important upgrade that introduces some bug fixes and a lot of new capabilities. = 1.2 = Optional upgrade in order to set additional capabilities. = 1.1 = Optional upgrade in order to set additional capabilities. = 1.0 = Initial version. == Attributes == The easiest way to use the plugin is to put the shortcode [inline_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) then you can use the following attributes: * **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. * **uploadtitle:** The title of the plugin. Default value is "Upload a file". * **selectbutton:** The title of the select button. Default value is "Select File". * **uploadbutton:** The title of the upload button. Default value is "Upload File". * **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. * **uploadpath:** This is the path of the upload directory. This directory must be inside the wp-contents folder of your WordPress site and the path must be relative to wp-contents. For instance, if your upload directory is "wp-contents/uploads/myuploaddir", then uploadpath must have the value "uploads/myuploaddir". The default value is "uploads", meaning that the files will be uploaded to wp-contents/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. * **createpath:** If this attribute is set to "true", the upload directory, defined by uploadpath, will be created in case it does not exist. Default value is "false". * **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. * **accessmethod:** This attributes 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:** This attribute 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. * **dublicatespolicy:** This attribute 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:** This attribute 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". * **filebaselink:** This attribute 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 inline_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. * **notify:** If this attribute is 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:** This attribute 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 (,). * **notifysubject:** This attribute defines the subject for the notification message. Default value is "File Upload Notification". You can use variables inside this attribute, as explained below. * **notifymessage:** This attribute 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. * **redirect:** This attribute defines if the user will be redirected to another web page when the file is uploaded successfully. Default value is "false". * **redirectlink:** This attribute 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. * **adminmessages:** This attribute 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". You can use any of these attributes to customize the plugin. The way to use these attributes is the following: `[inline_upload attribute1=value1 attribute2=value2]` Here are some examples: ` [inline_upload uploadtitle="Upload files to the Upload dir"] [inline_upload uploadtitle="Upload files to the Upload dir" uploadpath="uploads/myuploaddir"] [inline_upload uploadid="1" uploadpath="uploads/myuploaddir"] [inline_upload uploadpath="uploads/users/%username%" createpath="true"] [inline_upload uploadpath="uploads/myuploaddir" notify="true" notifyrecipients="name1@address1.com, name2@address2.com"] ` == 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: * **%username%:** Is replaced by the username of the current user. Can be used inside attributes *uploadpath*, *notifysubject* and *notifymessage*. * **%filename%:** Is replaced by the filename (not including path information) of the uploaded file. Can be used inside attributes *notifysubject* and *notifymessage*. * **%filepath%:** Is replaced by the filepath (full path and filename) of the uploaded file. Can be used inside attributes *notifysubject* and *notifymessage*. == Requirements == The plugin requires to have Javascript enabled in your browser. For Internet Explorer you also need to have Active-X enabled.