注册 登录
编程论坛 ASP技术论坛

【求助】化境无组件上传问题 ---(已解决了,答案在八楼)

zhuzhanjun 发布于 2008-05-07 12:14, 749 次点击
我用了 化境无组件上传  
上传后图片放在C:\Inetpub\wwwroot

怎么改路径。我看了很久都不会改~~

会的朋友帮下小弟,谢谢了。
在线等呢。~~~-

[[it] 本帖最后由 zhuzhanjun 于 2008-5-9 16:03 编辑 [/it]]
7 回复
#2
zhuzhanjun2008-05-07 17:07
怎么没有人回答我的问题哦
#3
multiple19022008-05-07 21:58
Save里可以设置保存文件地址呀
#4
zhuzhanjun2008-05-08 11:20
Public function SaveAs(FullPath)
    dim dr,ErrorChar,i
    SaveAs=true
    if trim(fullpath)="" or FileStart=0 or FileName="" or right(fullpath,1)="/" then exit function
    set dr=CreateObject("Adodb.Stream")
    dr.Mode=3
    dr.Type=1
    dr.Open
    Data_5xsoft.position=FileStart
    Data_5xsoft.copyto dr,FileSize
    dr.SaveToFile FullPath,2
    dr.Close
    set dr=nothing
    SaveAs=false
  end function

是改以上的代码吗?如果是,应该怎么改呢。版主大哥
#5
zhuzhanjun2008-05-08 11:35
<%
dim upload,file,formName,formPath,iCount
set upload=new upload_5xsoft ''建立上传对象

response.write upload.Version&"<br><br>"  ''显示上传类的版本

if upload.form("filepath")="" then   ''得到上传目录
 HtmEnd "请输入要上传至的目录!"
 set upload=nothing
 response.end
else
 formPath=upload.form("filepath")
 ''在目录后加(/)
 if right(formPath,1)<>"/" then formPath=formPath&"/"
end if

iCount=0
for each formName in upload.objForm ''列出所有form数据
 response.write formName&"="&upload.form(formName)&"<br>"
next

response.write "<br>"
for each formName in upload.objFile ''列出所有上传了的文件
 set file=upload.file(formName)  ''生成一个文件对象
 if file.FileSize>0 then         ''如果 FileSize > 0 说明有文件数据
  file.SaveAs Server.mappath(formPath&file.FileName)   ''保存文件
  response.write file.FilePath&file.FileName&" ("&file.FileSize&") => "&formPath&File.FileName&" 成功!<br>"
  iCount=iCount+1
 end if
 set file=nothing
next

set upload=nothing  ''删除此对象
Htmend iCount&" 个文件上传结束!"

sub HtmEnd(Msg)
 set upload=nothing
 response.write "<br>"&Msg&" [<a href=""javascript:history.back();"">返回</a>]</body></html>"
 response.end
end sub
%>

代码如上。怎么改呢
#6
zhuzhanjun2008-05-09 09:25
啊?没人回答呀
#7
heyufu2008-05-09 14:14
file.SaveAs Server.mappath(formPath&file.FileName)
这句就是说明文件保存的路径了。
#8
zhuzhanjun2008-05-09 15:44
我要的是修改保存图片路径的地方,谢谢楼上的兄弟。

问题我已经解决了
只有本站会员才能查看附件,请 登录


[[it] 本帖最后由 zhuzhanjun 于 2008-5-9 15:49 编辑 [/it]]
1