All Projects → pazguille → upfile

pazguille / upfile

Licence: MIT license
Makes file inputs a pleasure to use with progressive enhancement.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Upfile JS

Makes file inputs a pleasure to use with progressive enhancement.

Installation

$ component install pazguille/upfile

See: https://github.com/component/component

Standalone

Also, you can use the standalone version:

<script src="upfile.js"></script>

How-to

First, you should add the CSS file to your markup:

<link rel="stylesheet" href="upfile.css">

You should use the following HTML code on your files inputs:

<div class="upfile">
    <label class="upfile-label" for="demoInputFile">Select files...</label>
    <input id="demoInputFile" class="upfile-button" type="file" name="files[]" multiple>
</div>

Then, you can start to use it and enjoy!

var Upfile = require('upfile');
    inputFile = document.getElementById('demoInputFile'),
    fileUploader = new Upfile(inputFile);

View demo page

API

Upfile(el)

Create a new instance of Upfile.

  • el: A given HTMLElement file input to create an instance of Upfile.
var upfile = new Upfile(el);

Upfile#enable()

Enables an instance of Upfile.

upfile.enable();

Upfile#disable()

Disables an instance of Upfile.

upfile.disable();

Contact

License

Copyright (c) 2013 @pazguille Licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].