jQuery asynchronous upload plugin
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
puploady.jquery.json
puploady.js

README.md

pUploady

A very light jQuery plugin to upload your files asynchronously with a progress bar.

Credits

  • jQuery (http://jquery.com | (c) 2005, 2014 jQuery Foundation, Inc. and other contributors | MIT license)

License

pUploady is released under the MIT license.

Copyright (c) orugari

Requirement

HTML5 is necessary to use this plugin. Check also the minimum version for each browser.

[Chrome 8.0] [Internet Explorer 10.0] [Firefox 16.0] [Safari 6.0] [Opera 11.0]

Installation

Load jQuery then pUploady plugin in <head></head>.

<script src="https://code.jquery.com/jquery-2.1.3.min.js" />
<script src="js/puploady.min.js" /></script>

You will also need a php file.

Usage

HTML:

<form method="post" action="" enctype="multipart/form-data">
	<input type="file" name="the_file" required />
	<input type="submit" />
</form>

JS:

$("form").puploady({
	file        : 'upload.php',     //where you will manage data from the form (default: upload.php)
	callback    : false     //if you want a callback (default: false)
})

PHP (in upload.php):

<?php
$the_dir = 'uploads/';
$the_file = $the_dir . basename($_FILES['the_file']['name']);

if(move_uploaded_file($_FILES['the_file']['tmp_name'], $the_file)) {    echo "File uploaded";   }
else {  echo "Upload failed";   }
?>