导航:首页 > 版本升级 > asp无组件上传多文件

asp无组件上传多文件

发布时间:2025-08-18 01:16:36

❶ 如何在网页实现上传各种文件或图片视频等功能

回答如下:

1、无组件上传系统,只要空间支持ASP,就可以使用,一般不会和空间冲突。

2、一般来说,你下载的源码中都是含有使用方法的,我大致说一下吧:

比如你图上的3个脚本,你可以在index.asp中放置一个表单,表单的提交(action="upload.asp")指向upload.asp脚本。在upload.asp脚本中,你需要调用upload_class.asp这个文件(这个文件定义的是一个上传类和一些参数的接口),通过定义的参数和表单提交来的信息,获取到文件的相关信息,比如大小、文件名等。

这2个文件里应该会有详细的说明啊,我当时就是看了这个说明使用的。很好用哦

❷ 关于化境ASP无组件上传类 - upload_5xsoft 使用的问题

菜名:<input type=text name="sname">
图片:<input type=file name="sfile">

<%
set upload=upload_5xsoft
set file=upload.files("sfile")
filename=新文件名称&Mid(file.filename,instr(file.filename,"."))
'如:新文件名.jpg
file.saveas server.mappath("..\upload\"&filename)
formname=upload.forms("sname")
set file=nothing
set upload=nothing

set conn=server...
set rs=server...
rs.open"select * from..."
rs.addnew
rs("菜名")=formname
rs("图片")=filename
rs.update
rs.close
...

%>

❸ ASP怎样无组件上传文件到指定文件夹,并且将路径写入数据库如题 谢谢了

<head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>示例结果</title> <link href="../style.css" rel="stylesheet" type="text/css"> </head> <body style="font-size:12px"> <% Dim Upload,successful '=============================================================================== set Upload=new AnUpload '创建类实例 Upload.SingleSize=1024*1024 '设置单个文件最大上传限制,按字节计;默认为不限制 Upload.MaxSize=4096*1024 '设置最大上传限制,按字节计;默认为不限制 Upload.Exe="rar|jpg|bmp|gif|doc|xls|ppt|txt" '设置合法扩展名,以|分割,忽略大小写 Upload.GetData() '获取并保存数据,必须调用本方法 '=============================================================================== if Upload.Err>0 then '判断错误号,如果myupload.Err<=0表示正常 response.write Upload.Description '如果出现错误,获取错误描述 else response.Write "表单text1的值为: " & Upload.Forms("text1") & "<br />" if Upload.forms("file1")<>"" then '这里判断你file1是否选择了文件 path=server.mappath("files") '文件保存路径(这里是files文件夹) set tempCls=Upload.files("file1") successful=tempCls.SaveToFile(path,0) '以时间+随机数字为文件名保存 'successful=tempCls.SaveToFile(path,1) '如果想以原文件名保存,请使用本句 if successful then response.write tempCls.FileName & "上传完毕,大小为" & Upload.getsize(tempCls.Size) & ";<br />本地路径" & Upload.forms("file1") & "!<br />" Response.Redirect "InsertDatabase.asp?FileName="&Upload.Forms("text1")&"&FilePath="&tempCls.FileName else response.write "上传失败" end if set tempCls=nothing end if end if set Upload=nothing '销毁类实例 %> </body> </html>
采纳哦

❹ 求asp无组件上传图片代码 100分悬赏

ASP无组件上传图片源代码
<%
'上传方法,0=无组件,1=chinaaspupload
dim upload_type
upload_type=upload

dim uploadsuc
dim Forumupload
dim ranNum
dim uploadfiletype
dim upload,file,formName,formPath,iCount,filename,fileExt
response.write "<body leftmargin=0 topmargin=0>"
select case upload_type
case 0
call upload_0()
case 1
call upload_1()
case else
response.write "本系统未开放插件功能"
response.end
end select

sub upload_0()
set upload=new upload_5xSoft ''建立上传对象

formPath=upload.form("filepath")
''在目录后加(/)
if right(formPath,1)<>"/" then formPath=formPath&"/"

response.write "<body leftmargin=5 topmargin=3>"

for each formName in upload.file ''列出所有上传了的文件
set file=upload.file(formName) ''生成一个文件对象
if file.filesize<100 then
response.write "<span style=""font-family: 宋体; font-size: 9pt"">请先选择你要上传的图片 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>"
response.end
end if

if file.filesize>1024000 then
response.write "<span style=""font-family: 宋体; font-size: 9pt"">图片大小超过了限制 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>"
response.end
end if

fileExt=lcase(getFileExtName(file.fileName))

if fileext<>"jpg" and fileext<>"png" and fileext<>"gif" and fileext<>"bmp" then
response.write "<span style=""font-family: 宋体; font-size: 9pt"">该文件格式不允许上传 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>"
response.end
end if

randomize
rannum=int(90000*rnd)+10000
filename=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&rannum&"."&fileExt
%>
<%
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
file.SaveAs Server.mappath(formPath &filename) ''保存文件
response.write "<script>parent.document.FrmAddLink.photo.value='uploadfile/face/"&FileName&"'</script>"
end if
set file=nothing
next
set upload=nothing

Htmend iCount&" 个文件上传结束!"
end sub

sub HtmEnd(Msg)
response.write "<span style=""font-family: 宋体; font-size: 9pt"">图片上传成功 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>"

response.end
end sub

sub upload_1()
set FileUp=server.createobject("ChinaASP.UpLoad") ''建立上传对象

filepath=server.MapPath("../uploadfile/face/")

response.write "<body leftmargin=5 topmargin=3>"
for each f in fileup.Files ''列出所有上传了的文件

if f.filesize<100 then
response.write "<span style=""font-family: 宋体; font-size: 9pt"">请先选择你要上传的图片 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>"
response.end
end if

if f.filesize>1024000 then
response.write "<span style=""font-family: 宋体; font-size: 9pt"">图片大小超过了限制 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>"
response.end
end if

fileExt=lcase(getFileExtName(f.fileName))

if fileext<>"jpg" and fileext<>"png" and fileext<>"gif" and fileext<>"bmp" then
response.write "<span style=""font-family: 宋体; font-size: 9pt"">该文件格式不允许上传 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>"
response.end
end if

randomize
rannum=int(90000*rnd)+10000
filename=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&rannum&"."&fileExt
%>
<%
if f.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
f.saveas filePath & "\"&filename ''保存文件
response.write "<script>parent.document.FrmAddLink.photo.value='uploadfile/face/"&FileName&"'</script>"
end if
set f=nothing
next
set FileUp=nothing

Htmend iCount&" 个文件上传结束!"
end sub

sub HtmEnd(Msg)
response.write "<span style=""font-family: 宋体; font-size: 9pt"">图片上传成功 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>"

response.end
end sub
%>

❺ 化境ASP无组件类上传大文件的问题

如果不能上传大文件的话,那就是服务器2003系统上的设置问态缓题了.

解决办法:

1. 关闭 IIS Admin Service 服务 (运帆轮模行iisreset.exe /stop)

2. 打开桐消 Windows\system32\inesrv\metabase.xml

3. 修改 SPMaxRequestEntityAllowed 的值为自己需要的, 默认为 204800

4. 启动 IIS Admin Service (运行iisreset.exe /start)

注意备份metabase.xml 文件

❻ asp代码怎样实现无组件上传

一、无组件上传的原理
我还是一点一点用一个实例来说明的吧,客户端HTML如下。要浏览上传附件,我们通过<input type="file">元素,但是一定要注意必须设置form的enctype属性为"multipart/form-data":

<form method="post" action="upload.asp" enctype="multipart/form-data">
<label>
<input type="file" name="file1" />
</label>

<input type="text" name="filename" value="default filename"/>

<input type="submit" value="Submit"/>
<input type="reset" value="Reset"/>
</form>

在后台asp程序中,以前获取表单提交的ASCII 数据,非常的容易。但是如果需要获取上传的文件,就必须使用Request对象的BinaryRead方法来读取。BinaryRead方法是对当前输入流进行指定字节数的二进制读取,有点需要注意的是,一旦使用BinaryRead 方法后,再也不能使用Request.Form 或 Request.QueryString 集合了。结合Request对象的TotalBytes属性,可以将所有表单提交的数据全部变成二进制,不过这些数据都是经过编码的。首先让我们来看看这些数据是如何编码的,有无什么规律可循,编段代码,在代码中我们将BinaryRead读取的二进制转化为文本,输出出来,在后台的upload.asp中(注意该示例不要上传大文件,否则可能会造成浏览器死掉):
<%
Dim biData, PostData
Size = Request.TotalBytes
biData = Request.BinaryRead(Size)
PostData = BinaryToString(biData,Size)
Response.Write "<pre>" & PostData & "</pre>" '使用pre,原样输出格式
' 借助RecordSet将二进制流转化成文本
Function BinaryToString(biData,Size)
Const adLongVarChar = 201
Set RS = CreateObject("ADODB.Recordset")
RS.Fields.Append "mBinary", adLongVarChar, Size
RS.Open
RS.AddNew
RS("mBinary").AppendChunk(biData)
RS.Update
BinaryToString = RS("mBinary").Value
RS.Close
End Function
%>

❼ 如何在asp中使用无组件上传文件!

2个文件
第一个文件:
<html>
<body>
<center>
<form name="mainForm" enctype="multipart/form-data" action="process.asp" method=post>
<input type=file name=mefile><br>
<input type=submit name=okvalue="OK">
</form>
</center>
</body>
</html>

第二个:
<%
sub pic()
if Request.QueryString("submit")="pic" then
uploadpath="image/face/"
uploadsize="2048"
uploadtype="jpg/gif/png/bmp"
Set Uprequest=new UpLoadClass
Uprequest.SavePath=uploadpath
Uprequest.MaxSize=uploadsize*1024
Uprequest.FileType=uploadtype
AutoSave=true
Uprequest.open
if Uprequest.form("file_Err")<>0 then
select case Uprequest.form("file_Err")
case 1:str="<div style=""padding-top:5px;padding-bottom:5px;""> <font color=blue>上传不成功!文件超过"&uploadsize&"k [<a href='javascript:history.go(-1)'>重新上传</a>]</font></div>"
case 2:str="<div style=""padding-top:5px;padding-bottom:5px;""> <font color=blue>上传不成功!文件格式不对 [<a href='javascript:history.go(-1)']>重新上传</a>]</font></div>"
case 3:str="<div style=""padding-top:5px;padding-bottom:5px;""> <font color=blue>上传不成功!文件太大且格式不对 [<a href='javascript:history.go(-1)'>重新上传</a>]</font></div>"
end select
response.write str
else
response.write "<script language=""javascript"">parent.form2.pic.value='"&Uprequest.SavePath&Uprequest.Form("file")&"';"
response.write "</script>"
response.write "</script>"
size=Uprequest.Form("file_size")
showsize=size & " Byte"
if size>1024 then
size=(size\1024)
showsize=size & " KB"
end if
if size>1024 then
size=(size/1024)
showsize=formatnumber(size,2) & " MB"
end if
response.write "<script language=""javascript"">parent.form2.url.value='"&showsize&"';"
response.write "</script>"
response.write "<div style=""padding-top:5px;padding-bottom:5px;""> <font color=red>文件上传成功</font> [<a href='javascript:history.go(-1)'>重新上传</a>]</div>"
end if
Set Uprequest=nothing
end if
response.write "<form name=form action=?action=pic&submit=pic method=post enctype=multipart/form-data>"
response.write "<input type=file name=file class='tx' size='20'> "
response.write "<input type=submit name=submit value=上传 class=""tx1"">"
response.write "</form>"
end sub
%>

阅读全文

与asp无组件上传多文件相关的资料

热点内容
vf查询文件默认去哪里 浏览:146
哪些网站可以看到头条热度 浏览:210
网银支付接口代码 浏览:883
大数据技术专业和软件技术哪个难 浏览:244
领导加入微信群欢迎语 浏览:905
asp无组件上传多文件 浏览:709
为什么我的高德地图没有网络了 浏览:657
心脏监护仪黄色的是什么数据 浏览:713
怎么把桌面的文件隐藏的文件夹图标 浏览:280
造价要依据哪些文件 浏览:499
除了按键找图还有什么编程软件 浏览:352
什么是网络作文 浏览:454
7个字的文件夹 浏览:614
表格中两列数据条如何合并 浏览:872
javatcp封装 浏览:497
word文档红头文件标题怎么制作 浏览:553
app20什么意思 浏览:998
如何判断数据是否正态分布 浏览:551
电脑微信聊天记录搜索不到文件 浏览:190
word标题设计 浏览:495

友情链接