---
title: "problem med filname i session"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/6626-problem-med-filname-i-session"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Qonos"
published: "2000-09-18T18:22:00.000Z"
updated: "2000-09-19T07:05:00.000Z"
replies: 2
views: 177
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/6626-problem-med-filname-i-session"
---

# problem med filname i session

## #1 — Qonos, 2000-09-18T18:22Z

jag har provat en massa men fattar inte hur jag skall få in filnamnet i en session.. så här ser min kod ut..

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")

' Vart ska bilderna läggas på servern?
' Måste ändras
path = "d:\\clients\\version3.0\\wwwroot\\image\\small\\"

'Create and Write to a File
 Set MyFile = ScriptObject.CreateTextFile(path & filename)
	    
 For i = 1 to LenB(value)
	 MyFile.Write chr(AscB(MidB(value,i,1)))
 Next
 
 MyFile.Close

%\>
\<b\>Uppladdad bild: \</b\>\<%=filename%\>\<BR\>
\<img src="../image/small/\<%=filename%\>"\>
\<!--#include file="upload.asp"--\>

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

## #2 — Vide, 2000-09-19T06:35Z

Får du in filnamnet i variabeln filename?

I sånna fall:
Session("filename") = filename

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

## #3 — Qonos, 2000-09-19T07:05Z

ja så troode jag oxå att jag skulle göra och la in det innan
\<!--#include file="upload.asp"--\>

typ så här:
\<b\>Uppladdad bild: \</b\>\<%=filename%\>\<BR\>
\<img src="../image/small/\<%=filename%\>"\>
\<%Session("strfilename") = filename%\>

\<!--#include file="upload.asp"--\>

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/6626-problem-med-filname-i-session
