upp och hoppa
Har här ett upload script som jag skulle vilja ha så att .asp .asa och några andra filer inte visas i själva scriptet.
Kan någon hjälpa mig med detta? tack på förhand :)
<% Response.Buffer = true%>
<!--#include file="admin_upload_koppling.asp" -->
<%
' Här kollar vi hur många filer och mappar det finns
strFiler = antalfiler.Count
Set antalfiler = nothing
strMappar = antalmappar.Count
Set antalmappar = nothing
' Här skrivs utrymmesanvändningen ut
Response.Write "Mappen utnyttjar "
Dim stl, stl2
stl = mapp.Size
IF stl < 1024 then
Response.Write "<b>"&Round(stl)&"</b> bytes"
ELSE
stl2 = stl/1024
IF stl2 > 1024 then
Response.Write "<b>"&Round(stl2/1024,2)&"</b> Mb"
ELSE
Response.Write "<b>"&Round(stl2,2)&"</b> Kb"
END IF
END IF
%>
<table width='100%' cellpadding="1" cellspacing="1">
<%Dim sida, messe
sida = Request.ServerVariables("SCRIPT_NAME")
messe = Session("messe")
%>
<tr>
<td colspan=6> <table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="50" valign="top">
</td>
<td> </td>
<td width="50"> </td>
</tr>
</table></td>
</tr>
<tr>
<td colspan=6> <hr size=1 color=#000000> </td>
</tr>
<%
' Kollar om det finns några filer eller mappar
IF strFiler <> 0 Or strMappar <> 0 then%>
<tr>
<td width=17>
<%
' Funktionen för att man ska gå till överordnad mapp
k = Request("kat")
k = Replace(k,"/","\")
IF Len(k) <> 0 then
IF Instr(k,"\") then
myArray = Split(k,"\")
IF Ubound(myArray) <> 0 then
IntUpper = Ubound(myArray)-1
strKat = sida & "?kat="
For i = 0 to intUpper
strKat = strKat & myArray(i)
IF i <> intUpper then
strKat = strKat & "\"
END IF
Next
ELSE
strKat = sida
END IF
ELSE
strKat = sida
END IF
Response.Write "<a href='"&strKat&"'><img src='admin_upload_bilder\upp.gi?????f' width=13 height=16 border=0></a>"
END IF
%>
</td>
<td width=150>Namn</td>
<td width=65>Storlek</td>
<td width=150 colspan="3">Skapad</td>
</tr>
<%
' Här hämtas alla undermappar
For Each under In undermapp
%>
<tr>
<td width='17'>
<%
Response.Write "<img src='admin_upload_bilder\mapp.gif' height='16' width='16'>"
%>
</td>
<td width='150'><a href="<%=sida%>?kat=<%
IF Len(Request("kat")) <> 0 then
Response.Write Request("kat") & "\"
END IF
Response.Write under.Name %>">
<%Response.Write under.Name%>
</a></td>
<td width='65'>
<%
storlek = under.Size/1024
IF storlek > 1024 then
Response.Write Round(storlek/1024,2) & " Mb"
ELSEIF storlek > 1048576 then
Response.Write Round(storlek/1024/1024,2) & " Gb"
ELSE
Response.Write Round(storlek,2) & " Kb"
END IF
%>
</td>
<td width='145'>
<%Response.Write under.DateCreated%>
</td>
<td width='8'><a href="<%=sida%>?vad=raderamapp&mapp=<%
IF Len(Request("kat")) <> 0 then
Response.Write Request("kat") & "\"
END IF
Response.Write under.Name %>"> <img src="admin_upload_bilder\radera.gif" width="15" height="14" border="0"></a></td>
<td width='8'> </td>
</tr>
<%Next%>
<%
' Här hämtas alla filerna
For Each filen In mapp.files
%>
<tr>
<td width='17'>
<%
' Funktionen som hämtar bild beroende på filtillägget
namn = LCase(filen.name)
IF Instr(namn,".") then
arrNamn = Split(namn, ".", -1)
valde = arrNamn(Ubound(arrNamn))
ELSE
arrNamn = "ingen"
valde = arrNamn
END IF
bild = "admin_upload_bilder\" & valde & ".gif"
IF NOT filer.FileExists(Server.MapPath(bild)) then
bild2 = "admin_upload_bilder\inget.gif"
ELSE
bild2 = bild
END IF
Response.Write "<img src='" & bild2 & "' height='16' width='16'>"
%>
</td>
<td width='150'><a href="<%Response.Write mapp1 & "\" & filen.Name %>">
<%
Dim strFilnamn
strFilnamn = filen.Name
IF len(strFilnamn) > 19 then
IF Instr(strFilnamn,".") t?????hen
myArray = split(strFilnamn,".")
Response.Write Left(myArray(0),15) & "~"
Response.Write "." & myArray(Ubound(myArray))
ELSE
Response.Write Left(strFilnamn,19)
END IF
ELSE
Response.Write filen.Name
END IF%>
</a></td>
<td width='65'>
<%
storlek = filen.Size/1024
IF storlek > 1024 then
Response.Write Round(storlek/1024,2) & " Mb"
ELSE
Response.Write Round(storlek,2) & " Kb"
END IF
%>
</td>
<td width='145'>
<%Response.Write filen.DateCreated%>
</td>
<td width='8'><a href="<%=sida%>?vad=raderafil&fil=<%
IF Len(Request("kat")) <> 0 then
Response.Write Request("kat") & "\"
END IF
Response.Write filen.Name %>"><img src="admin_upload_bilder\radera.gif" width="15" height="14" border="0"></a></td>
<td width='8'> </td>
</tr>
<%Next
ELSE%>
<tr>
<td colspan="6">Inga filer uppladdade
och inga mappar skapade ännu...</td>
</tr>
<%END IF%>
<tr>
<td colspan='6'> <hr size='1' color='#000000'> </td>
</tr>
<tr>
<td colspan='6'>
<%
Response.Write "<form name='frmUpload' method='post' enctype='multipart/form-data'"
Response.Write "action='admin_upload_laddaupp.asp?do=laddaupp"
IF Len(Request("kat")) <> 0 then
Response.Write "&kat=" & Request("kat") & "\"
END IF
Response.Write "'>"
Response.Write "<input type='file' name='upload' size=30 style = 'width: 100%; margin-top: 2px; margin-bottom: 2px;'><br>"
Response.Write "<input type='file' name='upload2' size=30 style = 'width: 100%; margin-top: 2px; margin-bottom: 2px;'><br>"
Response.Write "<input type='file' name='upload3' size=30 style = 'width: 100%; margin-top: 2px; margin-bottom: 2px;'><br>"
Response.Write "<input type='file' name='upload4' size=30 style = 'width: 100%; margin-top: 2px; margin-bottom: 2px;'><br>"
Response.Write "<input type='file' name='upload5' size=30 style = 'width: 100%; margin-top: 2px; margin-bottom: 2px;'><br>"
Response.Write "<input type='submit' value='Ladda upp 1-5 filer' "
Res?????ponse.Write "style='border: #000000 1px solid; font-family: verdana; font-size: 10px'>"
Response.Write "<br><i>Filerna laddas upp till den mapp du "
Response.Write "befinner dig i just nu.</i></form>"
%>
</td>
</tr>
<tr>
<td align='left' colspan='6'>
<%
Response.Write "<form name='form1' method='post' action='" & sida & "?vad=skapa'>"
Response.Write "<input type=hidden name='mapp2' value='"
IF Len(Request("kat")) <> 0 then
Response.Write Request("kat") & "\"
END IF
Response.Write "'><input type=text name='mapp' "
Response.Write "style = 'width: 100%; margin-top: 2px; margin-bottom: 2px;'>"
Response.Write " <input type=submit name=Skicka value='Skapa mapp' "
Response.Write "style='border: #000000 1px solid; font-family: verdana; font-size: 10px'>"
Response.Write "<br><i>Mappen skapas i den mapp du "
Response.Write "befinner dig i just nu.</i></form>"
%>
</td>
</tr>
</table>

