fineupload instance code example
Example: multiple fine uploader in one page
<body>
<div id="bootstrapped-fine-uploader-1"></div>
<div id="bootstrapped-fine-uploader-2"></div>
<script src="fineuploader-3.3.0.js"></script>
<script>
function createUploaders() {
var uploader1 = new qq.FineUploader({
element: document.getElementById('bootstrapped-fine-uploader-1'),
request: {
endpoint: 'example.php?naam=test.jpg'
},
text: {
uploadButton: '<div><i class="icon-upload icon-white"></i> Test me now and upload a file</div>'
},
template: '<div class="qq-uploader span12">' +
'<pre class="qq-upload-drop-area span12"><span>{dragZoneText}</span></pre>' +
'<div class="qq-upload-button btn btn-success" style="width: auto;">{uploadButtonText}</div>' +
'<span class="qq-drop-processing"><span>{dropProcessingText}</span><span class="qq-drop-processing-spinner"></span></span>' +
'<ul class="qq-upload-list" style="margin-top: 10px; text-align: center;"></ul>' +
'</div>',
classes: {
success: 'alert alert-success',
fail: 'alert alert-error'
}
});
var uploader2 = new qq.FineUploader({
element: document.getElementById('bootstrapped-fine-uploader-2'),
request: {
endpoint: 'example.php?naam=test2.jpg'
},
text: {
uploadButton: '<div><i class="icon-upload icon-white"></i> Upload jpg</div>'
},
template: '<div class="qq-uploader span12">' +
'<pre class="qq-upload-drop-area span12"><span>{dragZoneText}</span></pre>' +
'<div class="qq-upload-button btn btn-success" style="width: auto;">{uploadButtonText}</div>' +
'<span class="qq-drop-processing"><span>{dropProcessingText}</span><span class="qq-drop-processing-spinner"></span></span>' +
'<ul class="qq-upload-list" style="margin-top: 10px; text-align: center;"></ul>' +
'</div>',
classes: {
success: 'alert alert-success',
fail: 'alert alert-error'
}
});
}
window.onload = createUploaders();
</script>
</body>