---
title: "Problem med upload + request.querystring"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/7667-problem-med-upload-request-querystring"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "MM"
published: "2001-01-11T08:33:00.000Z"
updated: "2001-01-11T08:33:00.000Z"
replies: 0
views: 169
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/7667-problem-med-upload-request-querystring"
---

# Problem med upload + request.querystring

## #1 — MM, 2001-01-11T08:33Z

Hej,

jag håller på att modifiera ett script för uppladdning utan komponent. Det funkar helt ok, men jag vill i raden (Server.mappath("dbimages/"&filename)) lägga in \<%= Request.QueryString("katalogid") %\> så att den sparar filen i den katalog man kommit ifrån, så att säga.
Någon som har tips om hur jag ska klämma in det, vore jag tacksam.
\-------
\<%
Response.Expires=0
Response.Buffer = TRUE
Response.Clear
'Response.BinaryWrite(Request.BinaryRead(Request.TotalBytes))
byteCount = Request.TotalBytes
'Response.BinaryWrite(Request.BinaryRead(varByteCount))

RequestBin = Request.BinaryRead(byteCount)
Dim UploadRequest
Set UploadRequest = CreateObject("Scripting.Dictionary")

BuildUploadRequest RequestBin

'email = UploadRequest.Item("email").Item("Value")

contentType = UploadRequest.Item("blob").Item("ContentType")
filepathname = UploadRequest.Item("blob").Item("FileName")
filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\\"))
value = UploadRequest.Item("blob").Item("Value")

'Create FileSytemObject Component
Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")

'Create and Write to a File
pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14
' Set MyFile = ScriptObject.CreateTextFile(Left(Server.mappath(Request.ServerVariables("PATH_INFO")),pathEnd)&filename)
Set MyFile = ScriptObject.CreateTextFile(Server.mappath("dbimages/"&filename))
response.write(Server.mappath(filename)) 

For i = 1 to LenB(value)
MyFile.Write chr(AscB(MidB(value,i,1)))
Next

MyFile.Close
%\> 
\-----

mvh Jonas

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/7667-problem-med-upload-request-querystring
