webForumDet fria alternativet

Ange mapp: upload utan komponent

0 svar · 174 visningar · startad av eddy1

eddy1Medlem sedan aug. 2001969 inlägg
#1

Har ett lite problem med ett uploadscript där jag vill bestäma i vilken mapp filen ska hamna. Som det är nu hamnar filen i den mapp som scriptfilen ligger, scriptfilen ligger i mapp 1:2 som ligger under mapp 1. men jag vill att den ska hamna i mapp 1:1 som ligger under mapp 1.
Så vill typ få in "../1:1/" men vet inte riktigt var???

Jättetacksam för hjälp, nedan följer koden...

<%
' Author Philippe Collignon

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)&amp;"uploaded"&amp;filename)

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

MyFile.Close
%>
<b>Fil sparad på server: </b><%=filename%><BR>
<img src="<%="uploaded"&amp;filename%>">
<!--#include file="upload.asp"-->

130 ms totalt · 3 externa anrop · v20260731065814-full.86db40fa
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
127 ms — hämta tråd, inlägg och bilagor (db)