04-22-2009, 06:16 AM
[eluser]yannyannyann[/eluser]
Hello
I have a jquery ajax upload system that works well.
However as I am uploading big files I would like to display a progress bar, or a simple percentage value, for the user to see that the upload didn't crash.
How could I implement that in my code ?
Hello
I have a jquery ajax upload system that works well.
However as I am uploading big files I would like to display a progress bar, or a simple percentage value, for the user to see that the upload didn't crash.
How could I implement that in my code ?
Code:
jQuery("#addVideoForm").validate({
rules: {
userfile: {
required: true,
accept: "mov|avi|mpg|flv"
}
},
submitHandler: function(form) {
jQuery(form).ajaxSubmit({
target: '#positive-result',
beforeSubmit: showRequest,
success: showResponse
});
}
function showRequest(formData, jqForm, options) {
$('#result').fadeIn("slow");
$('#positive-result').html("Uploading...");
var queryString = $.param(formData);
return true;
}
function showResponse(responseText, statusText) {
$('#positive-result').html( 'Video added.');
$('#result').fadeIn("slow");
}
});