displaying clients machine folder and files

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I have attached a javascript file my name folder.js.  what i am doing
in this .js file is i am passing the path of the directory and listing
them in the html table, again if there is any subfolder in that i
create a link and call (folderdisp(path)) this function recurrsively.
But problem is that i am not able to refresh the page, i have lost the
hook of the page also please have a look at this or          Guide me
how i can display the client machine folder on a browser and navigate
to its subfolder so that i dont loose te hook of that .aspx page.
Thanks in advance.

function folderdisp(path)

            //window.alert("Start :"+ path);

            var fso = new ActiveXObject('Scripting.FileSystemObject');

            if(fso.FolderExists(path) == true)
                document.write ("<html><head>");
                document.write ("<br><br><br><br><br>");
                document.write ("Files are downloaded to path  " +path);
                document.write ("<script language=javascript
                document.write ("<script language=vbscript
                document.write ("</head>");
                document.write("<table Border=0 align =left CellPadding=2>" );
                document.write("<tr bgcolor= #FFFFCC align =
center><td>"+"FolderName"+"</td>","<td>"+"Ext"+"</td>", "<td>"+"Created
Date"+"</td>", "<td>"+"Size"+"</td></tr>");

                var fold = fso.GetFolder(path);

                filesArrayString = '';

                //Find subfolders
                for (subfol = new Enumerator(fold.SubFolders);!subfol.atEnd();
                    var folname = subfol.item();

                    var nextfol = path+"/"+folname.name;
                    //window.alert("nextfol = "+nextfol);
                    var day,month,year,hrs,min;
                    DateC = new Date(folname.DateCreated);
                    day = DateC.getUTCDate();
                    month = DateC.getUTCMonth()+1;
                    year = DateC.getUTCFullYear();
                    hrs = DateC.getUTCHours();
                    min = DateC.getUTCMinutes();
                    var DispDate = day + "/" + month + "/" + year+"  "+hrs+":"+min;

                    //window.alert("Here :"+ nextfol);

                    document.write ("<tr bgcolor= #FFDBCA><td>"+"<A
                    window.alert("Folder end");

                //Find files
                for (files = new Enumerator(fold.files); !files.atEnd();
                    var thisFile = files.item();
                    var Fname = thisFile.name.split(".");
                    var fileDateC = new Date(thisFile.DateLastModified);
                    var fileday = fileDateC.getUTCDate();
                    var filemonth = fileDateC.getUTCMonth()+1;
                    var fileyear = fileDateC.getUTCFullYear();
                    var filehrs = fileDateC.getUTCHours();
                    var filemin = fileDateC.getUTCMinutes();

                    var fileDispDate = fileday  + "/" + filemonth  + "/" + fileyear +"
 "+filehrs+":"+ filemin ;

                    filepath = path+"/"+Fname[0]+"."+Fname[1];

                    //document.write ("<tr bgcolor=

                    //document.write ("<tr bgcolor= #FFCAE4><td><A href='#'

document.write ("<tr bgcolor= #FFCAE4><td><A href="+"\""+"#"+"\""+"
Quoted text here. Click to load it

                document.write ("</html>");

                window.alert("Folder does not exist in local");


Site Timeline