Hi,
Is there a way to clear the progress bar after the file upload is complete? I am using the WebUpload for uploading a single file only.
My ultimate objective is to "reset" the upload control on a server event.
Awaiting reply, thanks in advance.
Hi sharonks,
If you upload only one file you can setup mode to be "single".
Also you can hide the whole progressbar area. For instance: if your widget has id fileuploader then in fileuploaded event you can do $('#fileuploader_spbcntr').hide();
Also if you want after each upload to be shown info ONLY for one file you can do this:
$('#fileuploader').igUpload({
...
fileUploaded:
function (event, args) {
var $fileuploader = $(this), data = $fileuploader.igUpload('getFileInfoData');
data.fileSizeUploaded = 0;
//args.totalSize;
data.fileSizeTotal = 0;
if (data.countUploadingFiles === data.countTotalFiles) {
data.countUploadingFiles = 0;
data.countTotalFiles = 0;
}
},
});
In this way when you start uploading new file it will be shown that count of total files is 1 and total uploading file size is only for the file you upload. This is a hack and as I said if you want to upload only one file you can set mode to single.
Thanks,
Miro Hristov
Hi Miro Hristov,
Thank you for your response.
I tried implementing the solution you suggested, but it does not seem to work. The progress bar is not geting hidden. Please help!
Code:
function igFileUploaded(sender, eventArgs) {
$('#ctl00_ContentPlaceHolder1_WebUpload1_spbcntr').hide();
//$('#' + '<%=WebUpload1.ClientID %>' + '_spbcntr').hide();
//$('#WebUpload1_spbcntr').hide();
<ig:WebUpload ID="WebUpload1" runat="server" AutoStartUpload="true" ShowFileExtensionIcon="true" OnUploadFinished="WebUpload1_UploadFinished" ClientEvents-FileUploaded="igFileUploaded" ClientEvents-FileUploading="igFileUploading" LabelAddButton="Replace File"></ig:WebUpload>
Sharon