asp 上传

作者在 2006-11-15 05:37:00 发布以下内容

简单的文件上传

upload.html

<form name="FORM" action="upload.asp" method="post">
 <input type="submit" name="submit" value="OK">
<input type="file" name="file1" style="width:400" value="">
</form>

 

upload.asp:

<%
Function GetFileName(ByVal strFile)
If strFile <> "" Then
GetFileName = mid(strFile,InStrRev(strFile, "\")+1)
Else
GetFileName = ""
End If
End function

strFileName = Request.Form("file1")
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1 ' adTypeBinary
objStream.Open
objStream.LoadFromFile strFileName
objStream.SaveToFile Server.MapPath(GetFileName(strFileName)),2
objStream.Close
%>

asp | 阅读 744 次
文章评论,共0条
游客请输入验证码
浏览96319次