Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   IIS 5.0 Error path not fond (http://www.velocityreviews.com/forums/t792908-iis-5-0-error-path-not-fond.html)

Stas 01-25-2004 01:51 PM

IIS 5.0 Error path not fond
 
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.



Lance Wynn 01-25-2004 03:07 PM

Re: IIS 5.0 Error path not fond
 
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" <stsn2000@mail.ru> wrote in message
news:uVsJBn04DHA.3548@TK2MSFTNGP11.phx.gbl...
> 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.
>
>




Aaron Bertrand [MVP] 01-25-2004 09:50 PM

Re: IIS 5.0 Error path not fond
 
I answered this in another group. Please don't multi-post.

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




"Stas" <stsn2000@mail.ru> wrote in message
news:uVsJBn04DHA.3548@TK2MSFTNGP11.phx.gbl...
> 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.
>
>





All times are GMT. The time now is 05:49 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.