求上传图片到服务器上文件夹的代码

来源:百度知道 编辑:UC知道 时间:2024/05/21 07:30:50
最简单越好。
只要能上传图片到服务器上的一个指定文夹里就行了。
一个显示路径的窗口,一个浏览按钮,一个上传按钮,足够了。
写成ASP代码。

t1.htm:

<center>
<form name=x0 method=post ENCTYPE="multipart/form-data" action="http://xxxxxxx..../t1.asp">
<input type=file name="f1">
<input type=submit name=b1 value="上传图片">
</form>

t1.asp:

<%
Set str=Server.CreateObject("adodb.stream")
str.Type=1
str.Mode=3
str.Open
Set dec=Server.CreateObject("adodb.stream")
dec.Type=1
dec.Mode=3
dec.Open
str.write Request.BinaryRead(Request.TotalBytes)
str.position=0
sa1=str.Read
'''''''''''''
h1=chrb(13)&chrb(10)
t0=InStrB(sa1,h1 & h1)+4
if InStrB(sa1,h1)>0 then
tz=LeftB(sa1,InStrB(sa1,h1)-1)
end if
tt=InStrB(t0+1,sa1,tz)-t0-2
str.position=t0-1
st