Ajax Multi Upload for WordPress
About
Ajax Multi Upload is a WordPress plugin based on jQuery with following features:
  • upload single or multiple file via ajax,
  • resize image,
  • create image thumbnail (with keep image aspect ratio),
  • uploads files into WordPress gallery, so they can be managed,
  • easy integrate with forms,
  • submitting form using ajax,
  • create any numbers of thumbnails under one upload,
  • customizable crop parameter for thumbnails,
  • customizable thumbnails sizes and dimensions,
  • pass custom data,
  • files extension filters,
  • limit uploaded file size,
  • limit number of uploaded files,
  • auto upload, upload on click the button, upload on form submit
  • custom upload button,
  • upload statistics,
  • and more...
Implementation
Implementation requires to write shortcode with appropiate parameters (available parameters). For example:
[ajax_multi_upload startOn='auto' multi='true' maxSize='204800']
If you want to have just simple uploader with default parameters you can use shortcode without parameters:
[ajax_multi_upload]
There is also another way to implement Ajax Multi Upload. If you can't use shortcode on some part of your page or in some other plugin, you can try to use this method:
[ajax_multi_upload scriptsonly='true']
<input type='file' class='AMU' uploadScript='wp-content/plugins/ajax_multi_upload/upload.php' startOn='auto' multi='true' maxSize='204800' afterUpload='link' />
At first you've got to use shortcode with scriptsonly attribute: [ajax_multi_upload scriptsonly='true'], then in any place on your page, you can place <input type='file ... /> with some parameters. Required parameters: class='AMU', uploadScript='pathToYourUploadScript', multi and startOn.
Available parameters
There is some parameters that can defined behaviour of uploader. They can be used in [ajax_multi_upload] shortcode.

Parameter Default value Possible values Description
startOn manually auto
manually
onSubmit:formId
If set to auto, files will be uploaded on select.
If set to manually, files will be uploaded after click on upload button.
If set to onSubmit, files will be uploaded when the form with given id (after ':') will be submitted.
saveData true true
false
If parameter startOn is set to onSubmit:formId, then you can choose with saveData parameter if form data will be saved and available in admin area as custom post type.
postType amu_submission amu_submission
post
If parameter startOn is set to onSubmit:formId and saveData parameter is set to true, then you can choose post type for saved data.
attachImages currentPost currentPost
formSubmission
Specify if uploaded images will be attached to current post or to form submission custom post set by postType parameter.
sendMail false false
true
Specify if an email will be send after form submission. You can configure email template under Upload Submissions->Email template
requiredFields If parameter startOn is set to onSubmit:formId, then you can choose required form fields with this parameter. Example:
[ajax_multi_upload startOn='onSubmit:form' requiredFields='title,content' saveData='true' attachImages='formSubmission' filesLimit='2' multi='true' afterUpload='filename']
ajax false true
false
Can be used only, if startOn is set to onSubmit:formId. When ajax is set to true, form data will be send via ajax to script specified in form action parameter, using method (post or get) specified in form method parameter.
ajaxInfoId - - Can be used only, if ajax is set to true. Specified html node id where information outputted by script specified in form action parameter will be placed. So for example if you place in your php script (which submitted form) echo $message; the message will be placed in html node with ajaxInfoId id parameter.
ajaxLoaderId - - Can be used only, if ajax is set to true. Specified html node id which contains loader graphic. This node will be show before sending ajax request and will be hidden after getting response. Sample loader node can look like this: <span class="amu_loader" id="loader">
   <img src='wp-content/plugins/ajax_multi_upload/ajax-loader.gif'/>
</span>
To make it work use ajaxLoaderId='loader'
buttonCaption Upload - Upload button caption. Specify just if you use startOn="manually"
multi false true
false
true - multiple file uploads,
false - one file upload
afterUpload link image
link
filename
custom text
Specified what's appears after upload.
image - preview of uploaded file will be displayed,
link - link to the uploaded file will be displayed,
filename - the name of the uploaded file will be displayed,
custom text - your custom text will be displayed (for example afterUpload="Upload complete!")
If you specify custom text, you can use predefined variables to display some statistics:
  • AMUfilesUploaded - number of uploaded files
  • AMUerrors - number of occured errors
  • AMUtotalSizeB - total size of all uploaded files in bytes
  • AMUtotalSizeKB - total size of all uploaded files in kilobytes
  • AMUtotalSizeMB - total size of all uploaded files in megabytes
  • AMUtotalSizeGB - total size of all uploaded files in gigabytes
  • AMUspeedB - avarage upload speed in bytes per second
  • AMUspeedKB - avarage upload speed in kilobytes per second
  • AMUspeedMB - avarage upload speed in megabytes per second
  • AMUspeedGB - avarage upload speed in gigabytes per second
onprogress percentage percentage
speed
Specified type of information displayed when file is uploaded.
percentage - displayed percentage part of uploaded file,
speed - displayed avarage speed of upload in kB/s
thumbnails - - Dimension or dimensions of thumbnails that will be generated (in pixels).
For example if you want to generate a 90x90 thumbnail use thumbnails="90x90".
If you want to generate 3 thumbnails (first - 90x90, second - width 100px, heigth - keep aspect ratio, third - height 200px, width - keep aspect ratio) use thumbnails="90x90,100x,x200".
thumbnailsCrop false false
true
Specifies if thumbnails should be cropped. false - Soft proportional crop mode. true - Hard crop mode.
fileExt - - List of allowed file extensions, eg. fileExt="jpg,png,gif".
Notice: If you're using this parameter, you should also specify fileDesc parameter.
fileDesc - - The text that will appear at the bottom of the browse dialog box, eg. fileDesc="Images (jpg, png, gif)".
thumbnailsAfterUpload - image
link
filename
custom text
Specified what's appears after thumbnails generation.
image - preview of thumbnail will be displayed,
link - link to the thumbnail will be displayed,
filename - the name of the thumbnail will be displayed,
custom text - your custom text will be displayed.
This parameter should be used like thumbnails parameter, for example (for 3 thumbnails) thumbnailsAfterUpload="link,image,Thumbnail created!".
If you're not gonna specify this parameter, the thumbnails information/image will not be displayed.
maxSize - - The maximum upload file size in bytes.
hideButton false true
false
Enable to hide the flash button so you can style the underlying div element from your custom css (by for example background: url('your_button.png') no-repeat; parameter).
button - - Path to custom upload button.
bwidth 120 - Custom upload button width in pixels.
bheight 30 - Custom upload button height in pixels.
buttonText SELECT FILES - Caption of browse files button.
queueId - - The id of the custom upload queue. You can use your own upload queue, rather than default queue. Just create own queue and specify it's id. The files will be show in your custom queue.
data - - Custom data, that will be send to upload.php script. Data can be in json format or can contain jQuery dom element selectors from which value will be taken.
For example data="'variable1':'value1', 'variable2':'value2', 'formInput':'selector:[name=firstInput]', 'otherInput':'selector:#someId'".
method post post
get
Specified the method used to send data to upload script.
filesLimit - - Number value of maximum files that can be selected to upload.
filesMin - - Number value of minimum files required to be uploaded. Works with form integration onSubmit:formId
allowRemove false true
false
true - user can remove file after upload, false - user can't remove file after upload
removeData - - Custom data, that will be send using POST method to upload.php script, when user click on remove button (available when parameter allowRemove is set to true). Data can be in json format or can contain jQuery dom element selectors from which value will be taken.
For example: data="'variable1':'value1', 'variable2':'value2', 'formInput':'selector:[name=firstInput]', 'otherInput':'selector:#someId'".
sessionId - - If you want to use session in upload.php scirpt, you've got to specify this parameter. For example sessionId="your_php_session_id".
uploadScript PLUGIN_DIRECTORY/upload.php - The path to upload script.
wmode transparent - Set's flash wmode parameter.
packed false true
false
If it's set to true upload.packed.js script will be attached to page. It contains upload.min.js, swfobject.js and myupload.js files which are packed and minified. If it's set to false mentioned files will be attached separately.
scriptsOnly false true
false
If it's set to true only scripts required for uploader will be loaded, but uploader won't be initialized and you gonna put it manually somewhere on your page: <input type='file' class='AMU' ... /> (check implementation for more). If it's set to false all required scripts will be loaded and uploader will be initialized and displayed.
Form integration
Example of how to integrate [ajax_multi_upload] shortcode with form:
<form id="form" action="" method="post">
	<div class="amu_info" id="info"></div>
	<div>Title:</div>
	<input type="text" name="amu_title" />
	<div>Category:</div>
	[amu_blog_categories_dropdown multiple='1']
	<div>Add photos:</div>
	[ajax_multi_upload startOn='onSubmit:form' ajax='true' sendEmail='true' requiredFields='title,content' saveData='true' attachImages='formSubmission' filesLimit='2' multi='true' afterUpload='filename' fileExt='jpg,jpeg,png,gif' fileDesc='Images (*.jpg, *.jpeg, *.png, *.gif)' thumbnails='90x' thumbnailsCrop='false' thumbnailsAfterUpload='image' ajaxInfoId='info' ajaxLoaderId='loader' allowRemove='true' poststatus='publish']
	<div>Content:</div>
	[amu_content_editor]
	<div>Name:</div>
	<input type="text" name="amu_name" />
	<div>Surname:</div>
	<input type="text" name="amu_surname" />
	<div>Email:</div>
	<input type="text" name="amu_email" />
	<div>Website:</div>
	<input type="text" name="amu_website" />
	<input type="submit" name="amu_submit" value="Submit" />
	<input type="hidden" name="amu_action" value="submit" />
	<span class="amu_loader" id="loader">
		<img src='/wp-content/plugins/ajax_multi_upload/ajax-loader.gif'/>
	</span>
</form>
There are additional shortcodes which may be helpful. Examples with default parameters:
[amu_blog_categories_dropdown multiple='0' hide_empty='0']
and
[amu_content_editor media_buttons='0' tab_index='2' extended='0']
CSS styles
Ajax Multi Upload using one CSS file style.css. It includes classes that defining styles of upload queue, upload button, delete file button, etc.
  • After selecting the file/files upload queue will be created automatically (if queueId parameter is not specified). You can change its style using .uploadifyQueue class eg.
    .uploadifyQueue
    {
    	width: 625px;
    }
  • Items of the upload queue can be styled using .uploadifyQueueItem class eg.
    .uploadifyQueueItem
    {
    	margin-top: 5px;
    	padding: 5px;
    	border: 1px solid #D6D6D6;
    	background-color: #FFFFFF;
    	line-height: 17px !important;
    }
  • The upload button (if parameter auto is set to false) can be styled using .uploadButton class eg.
    .uploadButton
    {
    	width: 110px;
    	margin-top: 10px;
    }
  • The progress bar can be styled using two classes.uploadifyProgress and .uploadifyProgressBarclass eg.
    .uploadifyProgress
    {
    	background-color: #FFFFFF;
    	border-color: #808080 #C5C5C5 #C5C5C5 #808080;
    	border-style: solid;
    	border-width: 1px;
    	margin-top: 10px;
    	width: 100%;
    }
    .uploadifyProgressBar
    {
    	background-color: #869FB7;
    	height: 3px;
    	width: 1px;
    }
  • The uploaded image and uploaded thumbnail can be styled using this classes.uploadedImage, .uploadedThumbnail, .afterUploadThumbnail class eg.
    .uploadedImage
    {
    	border: none;
    	max-width: 438px;
    }
    .uploadedThumbnail
    {
    	border: none;
    	max-width: 200px;
    }
    .afterUploadThumbnail
    {
    	display: block;
    }
Please check style.css file for more.
Examples
You can see working examples on live preview page. You can also check live preview page html code in livePreviewAMUWP.html file, which you can find in help folder.
Support
Support for all our items is conducted through our Support Forum.
Please register an account and search the forum or create a new topic, we'll answer as soon as possible.

We're in GMT +1 and we aim to answer all questions within 24 hours (Monday – Friday). In some cases the waiting time can be extended to 48 hours.
Support requests sent during weekends or public holidays will be processed on next Monday or the next business day.