---
title: "Asp fel"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/12674-asp-fel"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "satchmo"
published: "2001-11-16T13:19:00.000Z"
updated: "2001-11-16T13:23:00.000Z"
replies: 1
views: 119
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/12674-asp-fel"
---

# Asp fel

## #1 — satchmo, 2001-11-16T13:19Z

Hej har ett litet problem med en kod, den funkar på pws men inte på min webserver. Server är en linux med asp tolk 
Felet är att den inte hittar katalogen, utan skriver ut sökvägen.
kolla in på så får ni se felet live. [http://www.ixor.org/\~satchmo/1/majime.asp](http://www.ixor.org/~satchmo/1/majime.asp) 

detta är koden

\<%  
 @language=JSCRIPT %\>
   \<% Filename = "test.asp" // Change this value. 
    %\>
\<HTML\>
   \<SCRIPT Language=VBSCRIPT Runat=Server\>
   Set fso = CreateObject("Scripting.FileSystemObject")
   path = Server.MapPath("test/")
   set f = fso.GetFolder(path)
   count=1
   for each fn in f.subFolders
   Session("Folders"&count) = replace (fn, path & "\\", "")
   count = count+1
   next
   session("Folders0") = count
   set f = fso.GetFolder(path & "/" & request.querystring("CurrentAlbum"))
   count = 1
   for each fn in f.Files
   if Right(fn, 4) = ".jpg" or Right(fn, 4) = ".gif" or Right(fn, 4) = ".JPG" or Right(fn, 4) = ".GIF" or Right(fn, 4) = ".BMP" or Right(fn, 4) = ".bmp" or Right(fn, 4) = ".jpeg" or Right(fn, 4) = ".JPEG" then
   Session("Files"&count) = replace (fn, path & "\\", "test/")
   count = count+1
   end if
   next
   session("Files0") = count
   \</SCRIPT\>
   \<%

   CurrentAlbum = Request.QueryString("CurrentAlbum");
   CurrentPhoto = Request.QueryString("CurrentPhoto");
   CurrentPhoto -= 1;
   CurrentPhoto++;
   FolderList = new Array;
   FileList = new Array;
   for (x=1; x \< Session("Folders0"); x++) {
      FolderList\[x-1\] = Session("Folders"+x);
      }
      for (x=1; x \< Session("Files0"); x++) {
         FileList\[x-1\] = Session("Files"+x)
         }
         /\*for (x=0; x \< FileList.length; x++) {
         Response.Write(FileList\[x\]+"\<BR\>");
         } \*/
         %\>
         \<%
         if (Request.QueryString("Mode") == "View") {
         %\>
         \<BODY BGCOLOR=#000000\>
            \<CENTER\>\<H1\>\<%= CurrentAlbum %\>\<H1\>\<BR\>
            \<H4\>\<I\>By Satchmo\</I\>\<H4\>\</CENTER\>
            \<BR\>
            \<BR\>
            \<CENTER\>
            \<table border=0 cellspacing=0 cellpadding=0 width=100% bgcolor=000000\>\<tr\>\<td\>
                     
      \<table width=100% border=0 cellspacing=1 cellpadding=3\>
        \<tr\>
          \<td colspan=1 bgcolor=#000000\> \<font color="#FFFFFF"\>\<font size=4\>\<CENTER\>Bild 
            \<%= CurrentPhoto + 1%\> av \<%= FileList.length %\> i album \<%= CurrentAlbum%\> 
            \</font\>\</td\>
        \</tr\>\<tr\>\<td bgcolor=000000 align = "center"\>\<font size=2\>
                                    \<img src=\<%= FileList\[CurrentPhoto\]%\> Alt="0001.jpg" border="0"\>
                              \</td\>\</tr\>
                              \<tr\>
          \<Td bgcolor=#000000\> 
            \<%
                                    if (CurrentPhoto \> 0) {
                                    %\>
            \<div align="center"\>\<a href = \<%= Filename+"?CurrentPhoto="+(CurrentPhoto - 1)+"&CurrentAlbum="+CurrentAlbum+"&mode=View"%\>\> 
              \<img src=\<%= FileList\[CurrentPhoto - 1\]%\> Alt="Bild nummer" height="150" border="0" align = "left"\> 
              \<%}
                                    %\>
              \<%if (CurrentPhoto \< FileList.length - 1) {
                                    %\>\<A href = \<%= Filename+"?CurrentPhoto="+(CurrentPhoto + 1)+"&CurrentAlbum="+CurrentAlbum+"&mode=View"%\>\> 
              \<img src=\<%= FileList\[CurrentPhoto + 1\]%\> Alt="Image" height="150" border="0" align = "right"\>\</a\> 
              \<%}
                                    %\>\<CENTER\>
              \<A HREF = \<%=Filename%\>\> Listan med albums\</A\> 
              \<!-- \</table\>\</td\>\</tr\>\</table\>\<br\>--\>
              \<%}
                        else {
                           %\>\<BODY BGCOLOR=#000000\>
              \<CENTER\>\<H1\>Satchmo's Photo Albums\<H1\>\<BR\>\<H4\>
              \<I\>By Satchmo\</I\>\<H4\>\</CENTER\> \<CENTER\> \<BR\>
              \<BR\>
            \</div\>
            \<table border=0 cellspacing=0 cellpadding=0 width=150 bgcolor=000000\>\<tr\>\<td\>
                                       \<table width=100% border=0 cellspacing=1 cellpadding=3\>\<tr\>\<td colspan=1 bgcolor=ffffff\>
                                                \<font size=4\>\<CENTER\>Välj Album\</CENTER\>
                                             \</td\>\</tr\>\<tr\>\<td bgcolor=FFFFFF\>\<font size=2\>
                                                      \<%
                                                      for (x=0; x \< FolderList.length; x++) {
                                                         %\>
                                                         \<A HREF = \<%= Filename+"?CurrentPhoto=0"+"&CurrentAlbum="+FolderList\[x\]+"&mode=View"%\>\>

                                                         \<%="\<li\>" + FolderList\[x\] + "\<BR\>" %\>\</a\>
                                                \</tr\>\</td\>\</TABLE\>\</TABLE\>
                                                \<%}
                                                %\>
                                       \</td\>\</tr\>\</table\>\</td\>\</tr\>\</table\>\<br\>
                                       \<%}
                                       %\>
\<!--#include file="menu.htm"--\>
\</HTML\>

Tackar på förhand för all hjälp.

Permalänk: https://www.webforum.nu/p/12674

## #2 — erka, 2001-11-16T13:23Z

Ett råd. Asp är gjort för att köras på ms plattformen, kör man på annat kan man bara räkna med att det ska skita sig, tråkigt men sannt...

Permalänk: https://www.webforum.nu/p/294754

---

Tråden på webben: https://www.webforum.nu/amne/asp/12674-asp-fel
