 |
<!--With the Scripting.FileSystemObject you can, amongst others, read file specifications. This demo is for Internet Explorer only.--> <HTML> <HEAD> <TITLE> FileSystemObject </TITLE> <SCRIPT LANGUAGE="JScript"> var fso = new ActiveXObject("Scripting.FileSystemObject"); function ShowFileInfo() { var f, s, file; if ("object" != typeof(fso)) return; // User Cancelled file = document.f.file.value; f = fso.GetFile(file); s = "<PRE><B>Path</B> : " + f.Path.replace(f.Name,"") + "\n"; s += "<B>Name</B> : " + f.Name + "\n"; s += "<B>Type</B> : " + f.Type + "\n"; s += "<B>Size</B> : " + f.size + " bytes\n"; s += "<B>Created</B> : " + f.DateCreated + "\n"; s += "<B>Last Accessed</B> : " + f.DateLastAccessed + "\n"; s += "<B>Last Modified</B> : " + f.DateLastModified + "</PRE>"; document.all.info.innerHTML = s; } </SCRIPT> </HEAD> <BODY> <b>Remark:</b> This demo will fail when security settings disallow <br> the execution of scripts which are not marked as being safe. <br>In this case, you can <a href="http://www.jwscripts.com/scripts/download.php?id=59">download</a> this file and view it locally.<br><br> <form name=f> <h2>Select file</h2> <input size="45" type="file" name="file" onChange="if (document.all) ShowFileInfo()"> <h2>File info:</h2> <div id="info"></div> </BODY> </HTML>
|
|