ASP上传的一个问题

来源:百度知道 编辑:UC知道 时间:2024/04/27 22:41:27
为什么不论把站点文件夹放在哪个盘,上传的文件均跑到http://localhost/wwwroot/pic/目录下?
还有把站点文件夹上传到过程服务器后,通过http上传图片后,显示图片成功上传的网址却是服务器的绝对目录。而本应传到pic文伯夹里的图片却什么也没有。
请高手点拨。
下面是上传文件部分代码
<%
if request.QueryString("action")="save" then
dim upload,imgfile,filePath,extname,fname
set upload=new upload_5xsoft ''建立上传对象
set imgfile=upload.file("picfile")
'图片存储位置
imgdir=upload.Form("imgdir")

if imgfile.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
extname=right(imgfile.filename,3)
fname=year(now())&month(now())&day(now())&hour(now())&second(now())&minute(now())&"."&extname

image=replace(imgdir&fname,"/","\")
imgfile.SaveAs image
image=replace(image,server.MapPath("\"),"")
image=replace(image,"

imgfile.SaveAs image
改成
imgfile.SaveAs Server.MapPath("pic/"&fname)

表单获取变量无论是什么均改为为<%=request("image")%>

如果有server.MapPath("\")这样的内容,记得一定放在其它字符串后,比如server.MapPath("pic\")这样子的,你看行不行,不行可以联系我