IIS 5.0 Error path not fond

S

Stas

Hello All!
I found function for enumerate files in special folder and pasted in my asp
page, but Server generate error.
Who could tell me why server IIS 5.0 generate error, and how I must input
path for http://host/pdf?
<%
function ShowFolderFileList(folderspec)
{
var fso, f, f1, fc, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFolder(folderspec);
fc = new Enumerator(f.files);
s = ""; for (; !fc.atEnd(); fc.moveNext())
{
s += fc.item();
s += "";
}
return(s);
}
var str;
str = ShowFolderFileList('http://localhost/pdf'); or str =
ShowFolderFileList('/pdf');
^^^^^^^^^^^^^^^ error at this string Path not found

Response.Write(str);
%>
Thanks.
Stas.
 
L

Lance Wynn

You need to give it the local path to the file, not the url. Look in the
help files for Server.MapPath that returns a string showing the actual
physical path of a file within the website.
I believe you'd do:
str = ShowFolderFileList(mapPath('/pdf'))

Lance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top