how rename for files at display level(useri nterface)

Last post 01-18-2012, 7:01 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  01-18-2012, 4:08 AM 72729

    how rename for files at display level(useri nterface)

    how rename files here as order entry1,order entry 2 .
  •  01-18-2012, 7:01 AM 72738 in reply to 72729

    Re: how rename for files at display level(useri nterface)

    Hi sruthi123,
     
    You can custom the queue table to achieve it. The examle below show you how to do that.
     
    <%@ Language="VBScript" %>
    <!-- #include file="aspuploader/include_aspuploader.asp" -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>
            Form - Single File Upload
        </title>
    </head>
    <body>
             <%
                Dim uploader
                Set uploader=new AspUploader
                uploader.Name="myuploader"
                uploader.InsertText="Upload File (Max 10M)"
                uploader.MultipleFilesUpload=true
                  uploader.render()
            %>
            
            <br/><br/>
              <div id="queuediv" style="display: none;">
                <div id="queuedivtablecontainer">
                </div>
                <div style="font-size: larger; padding-left: 100px; margin: 4px;">
                                  <a href="#" onclick="cancelalltasks();return false;">Cancel all tasks.</a>
                </div>
            </div>
        <div >

    <script>

    var uploader = document.getElementById("myuploader");
    uploader.handlequeueui=myqueueuihandler;
    function myqueueuihandler(list)
    {
            document.getElementById("queuediv").style.display="";
            var container=document.getElementById("queuedivtablecontainer");
            container.innerHTML="";
            var table=document.createElement("table");
            table.style.borderCollapse="collapse";
            table.cellSpacing=0;
            
            table.border=1;
            table.borderColor="#ededed";
            table.width="360px";
            for(var i=0;i<list.length;i++)
            {
                var img=document.createElement("IMG");
                var imgFinish=document.createElement("IMG");
                var imgError=document.createElement("IMG");
                var imgUpload=document.createElement("IMG");
                var imgQueue=document.createElement("IMG");
                img.src="aspuploader/resources/circle.png";
                imgFinish.src="aspuploader/resources/uploadok.png";
                imgError.src="aspuploader/resources/uploaderror.png";
                imgUpload.src="aspuploader/resources/uploading.gif";
                imgQueue.src="aspuploader/resources/stop.png";
                var name=list[i].FileName
                var size=list[i].FileSize // (or -1)
                var stat=list[i].Status    // Finish|Error|Upload|Queue
                var func=list[i].Cancel;
                var row=table.insertRow(-1);
                row.insertCell(-1).appendChild(img);
                //if want to use the custom file name, please handle the name by the line below
                row.insertCell(-1).innerHTML="custom file name";
                //if want to use the default file name, please use the line below
                //row.insertCell(-1).innerHTML=name;
                
                var last=row.insertCell(-1);
                if(stat=="Queue")
                {
                imgQueue.onclick=func;
                    last.appendChild(imgQueue);
                }
                else if(stat=="Finish")
                {
                    last.appendChild(imgFinish);
                }
                else if(stat=="Error")
                {
                    last.appendChild(imgError);
                }
                else if(stat=="Upload")
                {
                    last.appendChild(imgUpload);
                }

            }
            
            container.appendChild(table);

        return false; //hide the default;
    }
    function cancelalltasks()
    {
            
        uploader.cancelall();
        document.getElementById("queuediv").style.display="none";
    }

    </script>    
        </div>
    </body>
    </html>
     
    Regards,
     
    Ken
View as RSS news feed in XML