Place for some configs

Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc, litot Europa usa li sam vocabular. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores.

File v 1.2

Converts an file upload field into a multi upload form

General Idea

The problem with file uploads is that they require different data types and the files can be large which causes a delay after submitting the form. Because of this reason the wl_File plugin transfers the files via an AJAX request:

  1. User select file to upload via his file explorer (WIN) or finder (MAC)
  2. The files get send to a script (script A) which saves the files temporarily
  3. The user submit the form and only a list of uploaded files is sent to the server (to script B)
  4. script B must handle the list and move the files from the temp folder to the desired destination

This plugin requires server side action (upload.php)

Options read more about inline data attributes

optiondefaultpossible valuesdescriptionsinceinfo
autoUploadtruetrue | false The upload starts immediately after adding a file1.0
paramName'files''String' The name attribute used to send to the server1.0must be equal the param_name option in the upload.php
multipletruetrue | false Allowes multiple file upload. Can be set within the native input field1.0Currently not supported in Internet Explorer
allowedExtensionsfalsefalse, Array define allowed file extensions. If set to false all fiels are allowed1.0
maxNumberOfFiles0integer define maximum of allowed files for the upload field. Set to 0 to disable1.0
maxFileSize0integer defines the maximum file size for a file1.0not available on Internet Explorer
minFileSize0integer defines the maximum file size for a file1.0not available on Internet Explorer
sequentialUploadsfalsetrue | false Set this option to true to issue all file upload requests in a sequential order instead of simultaneous requests1.0
dragAndDroptruetrue | false Enables drag & drop support in modern browser1.0
formDatanullArray, Object, function additional data sent to the upload script1.0
text[texts]object an object with all required texts1.0
onAddfunction(e, data){}function(event, data) callback for adding files to the list1.0
onSendfunction(e, data){}function(event, data) callback on sending fiels to the server. Return false prevent sending data1.0
onDonefunction(e, data){}function(event, data) callback if one file was succesfully uploaded1.0
onFinishfunction(e, data){}function(event, data) callback if all files where succesfully uploaded1.0
onFailfunction(e, data){}function(event, data) callback if an error occurs1.0
onAlwaysfunction(e, data){}function(event, data) callback gets called in any case (always)1.0
onProgressfunction(e, data){}function(event, data) callback during upload progress for one file1.0only available on modern browsers
onProgressAllfunction(e, data){}function(event, data) callback during upload progress for all files1.0only available on modern browsers
onStartfunction(e){}function(event) callback on start of the upload1.0
onStopfunction(e){}function(event) callback if the upload is finished1.0
onChangefunction(e, data){}function(event, data) callback if a file is added or removed to the list1.0
onDropfunction(e, data){}function(event, data) callback if a file is droped from the users file system1.0
onDragOverfunction(e){}function(event) callback if the user drags a file from his file system over the dropzone1.0
onFileErrorfunction(error, fileobj){}function(error, fileobj) callback if an error occures on file add.
error:
error.msg : maxNumberOfFiles|allowedExtensions|maxFileSize|minFileSize
error.code : 1|2|3|4
1.0file.size is not available on Internet Explorer
Check out jQuery-File-Upload plugin docs for all options

Methods

method namedefaultargumentsdescriptionsinceinfo
reset removes all files from the list1.2
setkey, value sets the the option 'key' with the value 'value'1.0

Usage

$(selector).wl_File([options]);

Calling Methods

$(selector).wl_File('method', [,arg [,arg]]);

Markup

<form action="submit.php" method="post">
	<fieldset>
		<label>Fieldset Label</label>
		<section><label for="input">Label</label>
			<div><input type="file" id="file_upload" name="file_upload" multiple></div>
		</section>
		...
		<section>
			<div><button>Submit</button></div>
		</section>
	</fieldset>
</form>

Example