Modtage billede via HTTP
Hej,Jeg skal modtage jpeg billeder via en HTTP, jeg har fået det har fået det her script men det ser ikke ud til at virke:
<%
intPostTotalBytes = request.totalbytes
bstrPostData = Request.BinaryRead(intPostTotalBytes)
sagID = getF
mglID = getF
Image = getF
SELECT CASE Image
CASE "901" billede = "image00"
CASE "921" billede = "image01"
CASE "922" billede = "image02"
CASE "923" billede = "image03"
CASE "924" billede = "image04"
CASE "925" billede = "image05"
CASE "926" billede = "image06"
CASE "927" billede = "image07"
CASE "928" billede = "image08"
CASE "929" billede = "image09"
CASE "930" billede = "image10"
CASE ELSE billede = "Unknown"
END SELECT
MyFile = sagID & "_" & mglID & "_" & billede & ".jpg"
set ts = fs.CreateTextFile("d:\web\website\Images\"&MyFile&"", True)
For i = 1 To lenB(bstrPostData)
ts.Write(Chr(AscB(MidB(bstrPostData, i, 1))))
Next
ts.close
End if
response.write "OK"
Function GetF()
offset = InStrB(bstrPostData, chrB(10))
GetF = bin2str(LeftB(bstrPostData,offset-1))
bstrPostData = MidB(bstrPostData,offset+1,intPostTotalBytes)
End Function
Function bin2str(bstrBinary)
For i = 1 To LenB(bstrBinary)
bin2str = bin2str & Chr(AscB(MidB(bstrBinary, i, 1)))
Next
bin2str = trim(bin2str)
End Function
%>
Billedet skal gemmes i den mappe der hedder images, det er også her filen er placeret.
Håber I kan hjælpe.
