Отредактировано (x2):
Примерно так:
<script type="text/javascript">
var queueSize = 0;
function startUpload(){
if (queueSize == 0) {
alert("Please select a file first.");
} else {
$("#fileUpload").fileUploadStart();
}
}
</script>
<script type="text/javascript">
$("#fileUpload").fileUpload({
onCancel: function (a, b, c, d) {
queueSize = d.fileCount;
},
onClearQueue: function (a, b) {
queueSize = b.fileCount;
},
onSelectOnce: function (a, b) {
queueSize = b.fileCount;
},
onAllComplete: function () {
queueSize = 0;
},
onComplete: function (a, b ,c, d, e) {
queueSize = 0;
},
});
</script>
Который вы бы назвали:
startUpload();