File upload
Simple AJAX file upload with Bootstrap styled progress bar
by parksd
HTML
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>
<form>
<span class="fileUpload btn btn-default">
<span class="glyphicon glyphicon-upload"></span> Upload file
<input type="file" id="uploadFile" />
</span>
</form>
JavaScript
$("#uploadFile").change(function() {
var formData = new FormData();
alert(this.files[0].type);
});