Switch to full style
ASP/ASP.net examples
Post a reply

print all files names in folder

Wed Mar 30, 2011 11:48 pm

loop to print all files in folder
Code:
<%
Set objmyFileStream=Server.CreateObject("Scripting.FileSystemObject")
Set objmyFolderStream=objmyFileStream.GetFolder(Server.MapPath("/testfolder"))
For each objmyfile in objmyFolderStream.files
%>
<
b>File Found With Name :</b><% =objmyfile .Name %><br>

<%
Next
%>
 


To get the folder size :



Code:
<%
Set objfileStream= Server.CreateObject ("Scripting.FileSystemObject")
objfolderStream = Server.MapPath("/myfolder")
Set objfolder= objfileStream.GetFolder(folderStream )
%>
<
p><b><% =objfolderStream %> is (<% =objfolder.Size %> bytes)</b></p> 




Post a reply
  Related Posts  to : print all files names in folder
 Get all files in folder     -  
 Print all files in a directory     -  
 java code for listing folder contents from remote folder     -  
 Server Names Records     -  
 create folder in asp.net     -  
 copy folder     -  
 Zipping a Folder in java     -  
 check folder content using asp     -  
 get Folder path and size     -  
 check existence of file or folder in asp     -  

Topic Tags

ASP Files and I/O