In this step, you will add some events for uploading files and showing the progress.
<script type="text/javascript">
var supportXhr;
var progressbar;
function change(e, data) {
}
function complete(e, data) {
}
function progress(e, data) {
}
function totalComplete() {
progressbar.fadeOut(1500, function () {
if (supportXhr) {
$("#progressbar").wijprogressbar("option", "value", 0);
}
});
}
function totalProgress(e, data) {
if (supportXhr) {
$("#progressbar").wijprogressbar("option", "maxValue", data.total);
$("#progressbar").wijprogressbar("option", "value", data.loaded);
}
}
function totalUpload() {
progressbar.show();
}
function upload(e, data) {
}
function pageLoad() {
progressbar = $("#progressbar");
supportXhr = $("#ctl00_MainContent_uploadPanel").wijupload("supportXhr");
if (supportXhr) {
progressbar.wijprogressbar({ value: 0 });
} else {
progressbar.addClass("Loading");
}
progressbar.hide();
}
</script>
Now run the project to upload files.