听说空间不支持fso就不可以上传。。。
但我在本地调试时也不能(我用xp,以装好iis)
上传文件具体代码如下:
<%
if Request("menu")="up" then
Set upl = Server.CreateObject("SoftArtisans.FileUp")
filename=""&year(date)&""&month(date)&""&day(date)&""&hour(time)&""&minute(time)&""&second(time)&""
%>
<%
select case ""&upl.ContentType&""
case "application/octet-stream"
error2("未知文件格式")
case "image/gif"
types="gif"
case "image/pjpeg"
types="jpg"
case "text/html"
types="htm"
case "text/plain"
types="txt"
case "application/msword"
types="doc"
case "application/x-zip-compressed"
types="zip"
case "application/x-shockwave-flash"
types="swf"
end select
if upl.TotalBytes > 102400 then
error2("文件大小不得超过 100 K\n当前的文件大小为 "&int(upl.TotalBytes/1024)&" K")
end if
if types="gif" or types="jpg" then
img="[img]images/upfile/"&filename&"."&types&"[/img]"
elseif types="htm" or types="txt" or types="doc" or types="zip" or types="swf" then
img="[img]images/affix.gif[/img][url="&cluburl&"images/upfile/"&filename&"."&types&"]相关附件[/url]"
else
error2("对不起,本服务器只支持GIF、JPG、HTM、TXT、DOC、ZIP、SWF格式的文件\n不支持 "&upl.ContentType&" 格式的文件")
end if
if ""&upl.TotalBytes&""=""&Request.Cookies("TotalBytes")&"" then
error2("请不要上传相同的文件!")
end if
upl.SaveAs Server.mappath("images/upfile/"&filename&"."&types&"")
Response.Cookies("TotalBytes")=""&upl.TotalBytes&""
set upl=nothing
response.write ""
response.write "
"&cluburl&"images/upfile/"&filename&"."&types&""
response.end
else
%>