28,391
社区成员
发帖
与我相关
我的任务
分享
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
<form name="form" class="form" method="post" enctype="multipart/form-data" onsubmit="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>