Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > IIS 5.0 Error path not fond

Reply
Thread Tools

IIS 5.0 Error path not fond

 
 
Stas
Guest
Posts: n/a
 
      01-25-2004
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.


 
Reply With Quote
 
 
 
 
Lance Wynn
Guest
Posts: n/a
 
      01-25-2004
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

"Stas" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
 
 
 
Aaron Bertrand [MVP]
Guest
Posts: n/a
 
      01-25-2004
I answered this in another group. Please don't multi-post.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/




"Stas" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi-threaded C programming (for those fond of portability) Tomás Ó hÉilidhe C Programming 14 10-31-2008 05:40 PM
Somebody *really* got fond of python Diez B. Roggisch Python 1 04-21-2008 12:14 PM
Windows XP Pro won't fond my Network Adapter. Lil Jon Computer Support 3 07-18-2005 01:45 AM
Tomcat returning 404 error when using additional path (/servlet/myServlet/extra/path/info) Mupota Muchelemba Java 1 02-04-2004 12:43 AM
"Could not find a part of the path… " error on IIS 6.0 dsh ASP .Net Security 1 02-01-2004 06:25 AM



Advertisments