作者在 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
%>