Re: Custimazion in Progress bar info

  •  04-16-2010, 3:48 AM

    Re: Custimazion in Progress bar info

    Dear
    I  make a same function and it is firing but it will not displaying the Progress so please check whats worn in this code
     

    <tr valign="top" align="left">

    <td>

    <div id="queuediv" style="display: none;">

    <div id="queuedivtablecontainer">

    </div>

    <panel id="Panel1" runat="server">

    <div id='progressInfo' style="display:none;font-size:18px;color:Red">

    </div>

    </panel>

    <div style="font-size: larger; padding-left: 100px; margin: 4px;">

    <a href="#" onclick="cancelalltasks();return false;">Cancel all tasks.</a>

    </div>

    </div>

    <div style="height:400px; table-layout:fixed">

    <div >

    <cc1:UploadAttachments runat="server" ID="UploadAttachments1" UploadType="Auto" InsertButtonID="btpSelectFiles"

    OnFileUploaded="UploadAttachments1_FileUploaded" ManualStartUpload="true" CancelButtonID=""

    CancelAllMsg="" ShowProgressBar="true" ShowProgressInfo="true" ShowTableHeader="false"

    ShowFileIcons="true" ShowFrameBrowseButton="true" ProgressPanelWidth="970" TableStyle-Width="970"

    ProgressCtrlID="Panel1" ShowCheckBoxes="false">

    </cc1:UploadAttachments>

     

     

    </div>

    </div>

    <div align="right" style="padding: 10 10 10 10">

    <asp:Button runat="server" ID="SubmitButton" OnClientClick="return submitbutton_click()"

    Text="Next" OnClick="SubmitButton_Click" class="pagebutton" Style="margin-right: 50px" />

    <asp:Button runat="server" ID="btnCancel" Text="Cancel" Style="margin-right: 50px"

    class="pagebutton" />

    </div>

     

     

     

    </td>

    </tr>

    </table>

    <script type="text/javascript" language="javascript">

    function submitbutton_click() {

    var submitbutton = document.getElementById('<%=SubmitButton.ClientID %>');

    var uploadobj = document.getElementById('<%=UploadAttachments1.ClientID %>');

    if (!window.filesuploaded) {

    if (uploadobj.getqueuecount() > 0) {

    uploadobj.startupload();

    }

    else {

    alert("Please browse files for upload");

    }

    return false;

    }

    window.filesuploaded = false;

    return true;

    }

     

     

    function ToFixed(num) {

    if (num > 100)

    return Math.round(num);

    if (num > 10)

    return num.toFixed(1);

    return num.toFixed(2);

    }

    function FormatSize(bytecount) {

    var str = bytecount + ' B';

    if (Number(bytecount) >= 2048) { str = ToFixed(bytecount / 1024) + ' KB'; }

    if (Number(bytecount) >= 2097152) { str = ToFixed(bytecount / 1048576) + ' MB'; }

    if (Number(bytecount) >= 2147483648) { str = ToFixed(bytecount / 1073741824) + ' GB'; }

    return str;

    }

    var progressInfo = document.getElementById("progressInfo");

    var hasStarted = false;

    var startTime = 0;

    var fullSize = 0;

    var finishSize = 0;

    var queueSize = 0;

    var filecount = 0;

    function CuteWebUI_AjaxUploader_OnStart() {

    if (hasStarted) return;

    hasStarted = true;

    startTime = new Date().getTime();

    progressInfo.innerHTML = "Start upload";

    progressInfo.style.display = "";

    }

    function CuteWebUI_AjaxUploader_OnStop() {

    hasStarted = false;

    progressInfo.style.display = "none";

    }

    function CuteWebUI_AjaxUploader_OnPostback() {

    hasStarted = false;

    progressInfo.style.display = "none";

    }

    function CuteWebUI_AjaxUploader_OnQueueUI(list) {

    filecount = list.length;

    fullSize = 0;

    finishSize = 0;

    queueSize = 0;

    for (var i = 0; i < list.length; i++) {

    var size = list[i].FileSize; //or -1 if iframe mode

    var stat = list[i].Status;

    fullSize += size;

    if (stat == "Finish")

    finishSize += size;

    if (stat == "Queue")

    queueSize += size;

    }

    return true;

    }

    function CuteWebUI_AjaxUploader_OnProgress(enable, filename, begintime, uploadedsize, totalsize) {

    if (fullSize < 0) {

    progressInfo.innerHTML = "Unable to calculate total progress for iframe mode";

    return true;

    }

    if (!enable)

    return;

    if (!totalsize)

    return;

    var size1 = finishSize + uploadedsize;

    var size2 = queueSize + totalsize - uploadedsize;

    var size3 = size1 + size2;

    var seconds = (new Date().getTime() - startTime) / 1000;

    var speed = size1 / seconds;

    var timeleft = size2 / speed;

    progressInfo.innerHTML = "Uploading " + filecount + " files. " + FormatSize(size1) + " of " + FormatSize(size3) + " at " + FormatSize(Math.round(speed)) + "/s; " + Math.round(timeleft) + " seconds remaining ";

    //return false;

    }

     

     
View Complete Thread