如何使用w3 upload上传组件上传文件?
时间:2010-05-16 15:11:00
看看下面的w3 upload组件例子,很简单:
upload.asp
<html>
<head>
<title>w3 upload组件上传文件 - aspxhome.com</title>
</head>
<body>
' 用w3 upload组件上传
<form action="UploadProcess.asp" method="post" enctype="multipart/form-data">
<input type="file" name="thefile"><br>
选择一个文件名: <input type="text" name="name"><br>
<input type="submit" value="上传">
</form>
</body>
</html>
uploadprocess.asp
<% @ LANGUAGE="VBSCRIPT" %>
<%
Set upload = Server.CreateObject( "w3.upload" )
actualName = upload.Form( "name" )
Set fileName = upload.Form( "thefile" )
if fileName.IsFile then
fileName.SaveToFile( Request.ServerVariables( "APPL_PHYSICAL_PATH" ) & "\\" & actualName )
end if
%>
<html>
<body>
<br>
<br>
<center>
恭喜,文件上传成功!
</center>
<br>
<br>
<br>
</body>
</html>