关于使用upload_5xsoft上传的问题?

GoWish 2005-04-09 05:12:49
在使用upload_5xsoft上传时,
我想使用一个text和一个butto控件来代替file控件的效果,主要是因为按键名称要改为
"変 更",如下:
<input type="text" name="text" id="text">
<input type="button" value="変 更" onClick="file.click();text.value=file.value;">
<input type="file" name="file" id="file" style="display:none">
但是在提交时,确无法获得"file",不能正常上传文件,还是需要使用其他的控件替换才能代替file控件的效果呢,请大家帮忙看看,谢谢了!!!
----------------------------------------------
提交页面的代码如下:
<%OPTION EXPLICIT%>
<%Server.ScriptTimeOut=5000%>
<!--#include FILE="upload_5xsoft.inc"-->
<html>
<head>
<title></title>
</head>
<body>
<br><hr size=1 noshadow width=300 align=left><br><br>
<%
dim upload,file,formName,formPath,iCount
set upload=new upload_5xsoft

if upload.form("filepath")="" then
set upload=nothing
else
formPath=upload.form("filepath")
if right(formPath,1)<>"\" then formPath=formPath&"\"
end if

iCount=0
for each formName in upload.objForm
response.write "form:" & formName &"=" &upload.form(formName)&"<br>"
next

for each formName in upload.objFile
set file=upload.file(formName)
if file.FileSize>0 then
response.write file.FilePath&file.FileName&" ("&file.FileSize&") => "&formPath&File.FileName&"!<br>"
file.SaveAs formPath&file.FileName
iCount=iCount+1
end if
set file=nothing
next

set upload=nothing
%>
</body>
</html>
...全文
163 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
你在csdn里查帖主是xingyunyishui 的帖子看看有啥解决方法,挺bt的是用iframe的
GoWish 2005-04-09
  • 打赏
  • 举报
回复
to liuxiaoyi666(兔子):
我已经试过方法2了,但是还是不行,方法1要通过客户端的注册不符合现在的要求,还有
没有其他方法?另外,你提出的tStream.Charset ="gb2312"问题的原因是什么呢?

---------------------------------------------------------------------------
方法2:
<div style="position:absolute;top:11px;left:-71px;width:150;filter:alpha(opacity=0)" >
<input name="file" type="file" size=33 onpropertychange="a.value=this.value">
</div>
  • 打赏
  • 举报
回复
我的问题不知道怎么解决,不过你的问题很容易解决的

我给你的链接中有啊,那里有个用层模拟的方法就可以搞定的
GoWish 2005-04-09
  • 打赏
  • 举报
回复
to liuxiaoyi666(兔子):
有没有办法解决我提出的问题和你提出的问题呢?
  • 打赏
  • 举报
回复
无意之间发现了一个无组上传的bug

tStream.Charset ="gb2312" 哈哈,这样的话你的操作系统不同得到就不同*^_^*会出问题的
  • 打赏
  • 举报
回复
http://blog.csdn.net/liuxiaoyi666/archive/2005/01/17/257209.aspx
  • 打赏
  • 举报
回复
这个不是你的上传组件的问题,这个有关于file的安全性的问题

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧