网站上传页面怎么做

来源:百度知道 编辑:UC知道 时间:2024/04/30 07:19:10
我要做一个文件上传页面,文件要上传到我指定的FTP服务器上的一个文件夹里面,并且要知道是谁上传的?

如:
上传的文件:: { }浏览 最多可以上三个
上传说明::{}
用户名::{}
提交

你可以找个bbs软件下载一下,在里面找到相关内容 如upfile.asp
这里有些代码,参考一下
<!-- #include file="setup.asp" -->
<!--#include FILE="inc/upfile.asp"-->
<%
if Request.Cookies("username")=empty then error2("您还未登录社区")

sub check(typ)
if instr("|"&UpFileGenre&"|","|"&typ&"|") <= 0 or typ="asp" then error2("对不起,本服务器不支持 "&typ&" 格式的文件")
end sub

if Request("menu")="up" then

'生成目录
on error resume next
Set fso = Server.CreateObject("Scripting.FileSystemObject")
strDir="./images/upfile/"&year(now)&"-"&month(now)&""
if not fso.folderexists(Server.MapPath(strDir)) then fso.CreateFolder(Server.MapPath(strDir))
if Err=0 then catalog=""&year(now)&"-"&month(now)&"/"
ftime=""&catalog&year(now)&month(now)&da