if Request.ServerVariables("REQUEST_METHOD") = "POST" then
dim up, fso, filePath
set fso = Server.CreateObject("Scripting.FileSystemObject")
filePath = year(date) & "-" & month(date) & "/" '使用 "年-月" 形式的目录
if not fso.FolderExists(Server.MapPath(UPLOAD_PATH & filePath)) then
fso.CreateFolder(Server.MapPath(UPLOAD_PATH & filePath))
end if
'开始上传
set up = new UploadClass
up.AutoSave = 0 '取无重复的服务器时间字符串为文件名自动保存文件
up.SavePath = UPLOAD_PATH & filePath
up.FileType = "rar/zip/doc/docx/wps"
up.MaxSize = 1024 * 1024 * 10 '最大 10M
up.Open()
if up.Error <> 0 or up.Form("file_Err") <> "" then
Response.Write "<script>alert('上传出错!');</script>"
Response.end
end if
end if
下面是Html代码
<form name="form" class="form" method="post" enctype="multipart/form-data" οnsubmit="return check(this);">
<ul>
<li class="field">
<div class="input">
<label for="email">上传简历:</label>
<input name="file" type="file" size="36" maxlength="50" class="file" /> <span style="color:#F00;"> * 支持.doc、.docx、.wps格式文件</span>
</div>
</li>
<li class="submit-field">
<div class="input clearfix"><input type="submit" value="提交" class="btn-submit" /><input type="reset" value="重置" class="btn-reset" /></div>
</li>
</ul>
</form>
检查出来了是因为 up.Form("file_Err") <> "" 这个地方出错了,可是不知道怎么导致的这里出错的
在线急等 分不多,全给了,谢谢了