把asp改成jsp
这是一段保存图片文件的asp代码,那位大大,能改成jsp执行的代码吗
<%
Response.Expires = -1
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "Cache-Control", "no-cache, must-revalidate"
%>
<%
Function GetRndFileName()
Dim tmpstr
randomize
tmpstr=Int(1000*rnd)
tmpstr=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&tmpstr
GetRndFileName=tmpstr
End Function
path="pictemp\"&getrndfilename()&".png"
TotalBytes = Request.TotalBytes
Set bSourceData = server.createobject("ADODB.Stream")
bSourceData.Open
bSourceData.Type = 1
biData = Request.BinaryRead(TotalBytes)
bSourceData.Write biData
bSourceData.SaveToFile (server.mappath(path))
set bsourcedata=nothing
response.write("fileurl="&replace(path,"\","\\"))
%>