Read file names??

Results 1 to 2 of 2

Thread: Read file names??

  1. #1
    Join Date
    Dec 1969

    Default Read file names??

    I have been given an assignment that I find really hard, and I wonder if it is possible to solve it using ASP!<BR>I need to, some how, sort all the files in a specified folder, and I need to store the filenames as variables for later use. The files can have numbers as their names, but the best would be if I could check the date/time when they were made.<BR>Is this possible to accomplish using asp, and if it is HOW??

  2. #2
    Join Date
    Dec 1969

    Default RE: Read file names??

    First thing you need to is to get all the files from the directory:<BR><BR> Set ObjFOL = ObjFSO.GetFolder(Server.MapPath("../userscontent/" & lcase(session("PublisherName"))))<BR> Set ObjFolderContents = ObjFOL.Files<BR> totalbytes = 0<BR> for each x in ObjFolderContents<BR> if x.size &#062; 0 then<BR> totalbytes = totalbytes + round(formatnumber(x.size/1024,2))<BR> end if<BR> bytes = round(formatnumber(x.size/1024,2))<BR> redim preserve current_file_array(ubound(current_file_array)+1)<B R> redim preserve bytes_array(ubound(bytes_array)+1)<BR> current_file_array(ubound(current_file_array)) =<BR> if bytes = 0 then bytes= "&#060; 1" end if <BR> bytes_array(ubound(bytes_array)) = bytes<BR> next<BR><BR><BR> set ObjFOL = nothing<BR> set ObjFolderContents = nothing<BR> set ObjFSO = nothing<BR><BR>hack that apart (just ripped it from my code), it stores the file sizes and names of each file. you can use other variables (using the File object) to get the other attributes...might help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts