关于asp上传文件的原文件名?
当上传文件成功后,输出XXX名件上传成功,可是不知怎样才知原文个名?<%FunctionGetFileName(ByValstrFile)IfstrFile<>""The...
当上传文件成功后,输出XXX名件上传成功,可是不知怎样才知原文个名?
<%
Function GetFileName(ByVal strFile)
If strFile <> "" Then
GetFileName = mid(strFile,InStrRev(strFile, "\")+1)
response.write (GetFileName)
Else
GetFileName = ""
End If
End function
strFileName = Request.TotalBytes
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.Write Request.BinaryRead(strFileName)
objStream.SaveToFile Server.MapPath(GetFileName(strFileName)),2
objStream.Close
response.write ”XXX文件上传成功!"
%> 展开
<%
Function GetFileName(ByVal strFile)
If strFile <> "" Then
GetFileName = mid(strFile,InStrRev(strFile, "\")+1)
response.write (GetFileName)
Else
GetFileName = ""
End If
End function
strFileName = Request.TotalBytes
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.Write Request.BinaryRead(strFileName)
objStream.SaveToFile Server.MapPath(GetFileName(strFileName)),2
objStream.Close
response.write ”XXX文件上传成功!"
%> 展开
2个回答
展开全部
<%strFileName = Request.TotalBytes
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.Write Request.BinaryRead(strFileName)
objStream.SaveToFile Server.MapPath(GetFileName(strFileName)),2
objStream.Close
response.write GetFileName(strFileName)&"文件上传成功!"
%>
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.Write Request.BinaryRead(strFileName)
objStream.SaveToFile Server.MapPath(GetFileName(strFileName)),2
objStream.Close
response.write GetFileName(strFileName)&"文件上传成功!"
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询