'create Scripting.FileSystemObject object.
'We will be using this FileSystemObject to
'iterate through the files in "uploaded" folder and display a list of them.
Set fso = Server.CreateObject("Scripting.FileSystemObject"
Dim folder ' "Uploaded" Folder
Set folder = fso.GetFolder(Server.MapPath(temp_path))
'temp_path is the folder you want to read your files
'use the reference to this folder to display a list of files it contains
If folder.Size > 0 Then
ctr = 1
For Each file In folder.Files %>
response.write file.Name & ", " & file.Size
Next
End If
'Folder.Size property to check if the folder is empty or not. If folder contains any
'files then Folder.Size will give us total number of bytes this folder contains. So if
'folder contains any files then we iterate through the Folder.Files collection and
'display all the file names along with their sizes.
%>
where 'sap' is the same folder or virtual directory where i stored this & all other asp files.
It gives me following error when viewed in browser ie6.
Error Type:
Server.MapPath(), ASP 0173 (0x80004005)
An invalid character was specified in the Path parameter for the MapPath method.
/asp/aspFile.asp, line 4
i tried specifying the path in different ways but it didn't work. what is wrong with it ? ?
------ sap
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.