ember Posted August 28, 2006 Share Posted August 28, 2006 Hello everyone,i was wondering if someone could explain me how to get some meta infoon a number of files, such as author and owner.it is for a .asp web page wich indexes a list of files and shows infoabout those files (name, type, date last modified, etc) so that whoaccesses the page can sort those files by the detail they wish, and ican't discover how to get the author and owner info about those files.thanks in advance,ember Link to comment Share on other sites More sharing options...
justsomeguy Posted August 28, 2006 Share Posted August 28, 2006 Try this:http://classicasp.aspfaq.com/files/directo...-of-a-file.html Link to comment Share on other sites More sharing options...
ember Posted August 28, 2006 Author Share Posted August 28, 2006 thanks, i'll try it Link to comment Share on other sites More sharing options...
ember Posted August 31, 2006 Author Share Posted August 31, 2006 thanks, it worked just fine =)but there are 2 little things:1st, it only works with physical drives, and i need it to work with virtual drives and relative paths.2nd, i need to have a sort of the files.any ideas?i found a script that solved these problems, but it doens't show the attributes i need, and I don't know how to "mix" them together...if needed i'll provide the code i'm using.thanks everyone,ember Link to comment Share on other sites More sharing options...
justsomeguy Posted August 31, 2006 Share Posted August 31, 2006 Yeah, please provide the code and we'll try to put it together. Link to comment Share on other sites More sharing options...
ember Posted August 31, 2006 Author Share Posted August 31, 2006 thanks!here it goes:<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title></head><body><% filesz = 0 fileown = 8 srv = Request.ServerVariables("SERVER_SOFTWARE") if instr(srv,"/5.0")>0 then filesz = 1 filecr = 6 fileac = 7 fileat = 10 elseif instr(srv,"/5")>0 or instr(srv,"/6")>0 then filesz = 1 filecr = 4 fileac = 5 fileat = 9 end if if filesz > 0 then folder = "C:\Documents and Settings\bb79brg\Desktop\" response.write "<b>File listing for " & folder & "</b><p>" response.write "<table border=0 cellpadding=5 cellspacing=1 align=center>" response.write "<tr>" response.write "<th bgcolor=#CECFCE align=center>Nome</th>" response.write "<th bgcolor=#CECFCE align=center>Tipo</th>" response.write "<th bgcolor=#CECFCE align=center>Tamanho</th>" response.write "<th bgcolor=#CECFCE align=center>Última Modificação</th>" response.write "<th bgcolor=#CECFCE align=center>Proprietário</th>" response.write "<th bgcolor=#CECFCE align=center>Autor</th>" response.write "</tr>" tds = "<td><nobr> " tde = " </nobr></td>" Set sh = CreateObject("Shell.Application") set fl = sh.Namespace(folder) for each f in fl.Items if not f.IsFolder then p = f.path fn = right(p, len(p)-instrRev(p,"\")) response.write "<tr>" & _ tds & fn & tde & _ tds & f.type & tde & _ tds & fl.GetDetailsOf(f,filesz) & tde & _ tds & f.modifyDate & tde & _ tds & fl.GetDetailsOf(f,fileown) & tde & _ tds & fl.GetDetailsOf(f,fileat) & tde & _ "</tr>" end if next set fl = nothing set sh = nothing response.write "</table>" else response.write "Unable to process results." end if %> </body></html>thanks in advance Link to comment Share on other sites More sharing options...
justsomeguy Posted August 31, 2006 Share Posted August 31, 2006 One problem is that at the top you say this is Javascript, but the code is VBScript. Make that change, see if it runs, and let me know what problems you are having with it. Link to comment Share on other sites More sharing options...
ember Posted September 1, 2006 Author Share Posted September 1, 2006 i've changed it, it runs the same, without problems. i just don't know how to modify it so it can sort the results, and to apply it to virtual directories and work with relative paths.best regards,ember Link to comment Share on other sites More sharing options...
ember Posted September 3, 2006 Author Share Posted September 3, 2006 anyone, any ideas? Link to comment Share on other sites More sharing options...
ember Posted September 4, 2006 Author Share Posted September 4, 2006 hello!there are developments!i made it to adapt the script to work with virtual directories, but there is a misshap that i dont understand:when calling the "CreateObject(Shell.Application)" instead of, i.e., returning the date created (12-05-2004) it returns the name of the object ("date created" instead of "12-05-2004"). what could be causing this?thanks in advance,ember Link to comment Share on other sites More sharing options...
justsomeguy Posted September 5, 2006 Share Posted September 5, 2006 Your lines have this syntax:tds & fl.GetDetailsOf(f,filesz) & tde & _ tds & f.modifyDate & tde & _ tds & fl.GetDetailsOf(f,fileown) & tde & _ tds & fl.GetDetailsOf(f,fileat) & tde & _So maybe try this instead:tds & fl.GetDetailsOf(f,filesz) & tde & _ tds & fl.GetDetailsOf(f,filecr) & tde & _ tds & fl.GetDetailsOf(f,fileown) & tde & _ tds & fl.GetDetailsOf(f,fileat) & tde & _ Link to comment Share on other sites More sharing options...
ember Posted September 8, 2006 Author Share Posted September 8, 2006 thanks, this is sorted out, i'm already using it!thanks again,br, ember Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now