Vet inte varför jag får åtkomst nekad när jag ska ladda upp en bild.
<!--#include file="../inc/function.asp" -->
<%If Request.QueryString("action") = "upload" Then
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set Mapp = FSO.GetFolder(Server.MapPath("../stuff"))
Set MyDrive = Mapp.subFolders%>
<table cellpadding="3" cellspacing="0" border="0" width="<%=HeadWidth%>" style="border-top:1px solid #375380;border-left:1px solid #375380;border-right:1px solid #375380" bgcolor="#4669A2">
<form name="pics" method="post" action="default.asp?cat=pics&action=picUpload" enctype="multipart/form-data">
<tr>
<td width="100%" bgcolor="#395684"><b>Ladda upp filer</b></td>
</tr>
</table>
<table width="100%" cellpadding="0" sellspacing="0" border="0" style="border:1px solid #375380" bgcolor="#4669A2">
<%For x = 1 To strUploads%>
<tr>
<td width="18%"><b>Mapp</b><br>
<select name="mappDir<%=x%>" class="input">
<option value="../stuff">Stuff<br>
<%For Each Folder in MyDrive%>
<option value="../stuff/<%=Folder.Name%>"><%=Folder.Name%><br>
<%Next%>
</select>
</td>
<td width="82%">
<b>Bild <%=x%>:</b><br><input type="file" name="file<%=x%>" style="width:90%" class="input">
</td>
</tr>
<%Next%>
<tr>
<td width="100%" colspan="2"> </td>
</tr>
<tr>
<td width="100%" colspan="2"><input type="submit" value="Ladda upp bilder" class="input"></td>
</tr>
</form>
<tr>
<td width="100%" colspan="2"> </td>
</tr>
</table>
<%ElseIf Request.QueryString("action") = "picUpload" Then
byteCount = Request.TotalBytes
RequestBin = Request.BinaryRead(byteCount)
Dim UploadRequest
Set UploadRequest = CreateObject("Scripting.Dictionary")
BuildUploadRequest RequestBin
For x = 1 To strUploads
If Not UploadRequest.Item("file" & x).Item("Value") = "" Then
filepathname = UploadRequest.Item("file" & x).Item("FileName")
filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\"))
value = UploadRequest.Item("file" & x).Item("Value")
dirMapp = uploadRequest.Item("mappDir" & x).Item("Value")
Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")
pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14
Set MyFile = ScriptObject.CreateTextFile(Server.mappath(dirMapp & filename))
For i = 1 to LenB(value)
MyFile.Write chr(AscB(MidB(value,i,1)))
Next
MyFile.Close
End If
Next
Response.Redirect "default.asp?cat=pics"
End If%>