如何用asp做网页上传啊?!·

椰子 2003-08-17 10:43:36
有没有高手帮忙告诉我怎么用asp
做出用网页上传文件的东东啊!?/
需要什么组件啊!·?
...全文
60 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
椰子 2003-08-19
  • 打赏
  • 举报
回复
多谢多谢!·
请问上传组件怎么用啊?!
哪儿有下载!?·
椰子 2003-08-19
  • 打赏
  • 举报
回复
多谢多谢!·
liniu 2003-08-18
  • 打赏
  • 举报
回复
方法有两种:
1。上传组件,使用方便,不过要在服务器上注册之后才能使用。移植性不好。国内有一个比较好的lyfupload上传组件,我用过还不错。
2。用ADO.Stream对象,现在的无组件上传程序都是用他来做的,其实也用了组件,只不过它是内置的ADO。网上有境化无组件上传的免费代码。
ttt2 2003-08-18
  • 打赏
  • 举报
回复
qjrein 2003-08-17
  • 打赏
  • 举报
回复
这是我见过的最短的上传代码
前台
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<BODY topmargin="0" leftmargin="0" bgcolor="papayawhip">
<FORM METHOD=post ACTION="upload1.asp" enctype="multipart/form-data" id=form1 name=form1>
<INPUT TYPE="file" NAME="file" >
<INPUT TYPE="submit" value="上传" id=submit1 name=submit1>
</FORM>
</BODY>
后台
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="font.css">
</head>
<body>
<%
dim contentlen
contentlen=request.totalbytes

if contentlen>102400 then
response.write "文件太大,超过100k,不允许上传。请返回"
else

dim content
content=request.binaryread(request.totalbytes)

'二进制相互转换
Function getByteString(StringStr)
getByteString=""
For i=1 to Len(StringStr)
char=Mid(StringStr,i,1)
getByteString=getByteString&chrB(AscB(char))
Next
End Function
Function getString(StringBin)
getString =""
For intCount = 1 to LenB(StringBin)
getString = getString & chr(AscB(MidB(StringBin,intCount,1)))
Next
End Function

dim upbeg,upend,lineone,linetwo,linethree,line1,line2,line3
upbeg=1
upend=instrb(upbeg,content,getbytestring(chr(10)))
lineone=midb(content,upbeg,upend-upbeg)
upbeg=upend+1
line1=lenb(lineone)
upend=instrb(upbeg,content,getbytestring(chr(10)))
linetwo=midb(content,upbeg,upend-upbeg)
upbeg=upend+1
line2=lenb(linetwo)
upend=instrb(upbeg,content,getbytestring(chr(13)))
linethree=midb(content,upbeg,upend-upbeg)
line3=lenb(linethree)

'获得文件名
dim pp,checknametemp,checklen,checkname,filename
pp=instrb(1,linetwo,getbytestring(chr(46)))
checknametemp=rightb(linetwo,line2-pp+1)
checklen=instrb(1,checknametemp,getbytestring(chr(34)))
checkname=getstring(leftb(checknametemp,checklen-1))
filename=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&checkname

'上传文件
dim alllen,upstream,upstreamend,file
alllen=line1+line2+line3+6
set upstream=server.createobject("adodb.stream")
set upstreamend=server.createobject("adodb.stream")
upstream.type=1
upstreamend.type=1
upstream.open
upstreamend.open
upstream.write content
upstream.position=alllen
file=upstream.read(clng(contentlen-alllen-line1-5))
upstreamend.write file
upstreamend.savetofile(server.mappath("news/pic/"&filename)) //该城你需要的目录
upstream.close
upstreamend.close
set upstream=nothing
set upstreamend=nothing

response.write("已上传")
end if
%>
</body>
在线演示:http://www.ncmem.com/products/image-uploader/demo/index.html 开发文档-ASP.NET(C#):http://www.cnblogs.com/xproer/archive/2011/01/09/1931278.html 开发文档-PHP:http://www.cnblogs.com/xproer/archive/2011/05/13/2045854.html 开发文档-JSP:http://www.cnblogs.com/xproer/archive/2011/05/20/2051887.html 产品介绍:http://www.cnblogs.com/xproer/archive/2010/08/09/1796077.html 升级日志:http://www.cnblogs.com/xproer/archive/2010/10/06/1844816.html 资源下载:crx安装包,xpi安装包,exe安装包,开发文档,ASP示例,ASP.NET示例,JSP示例,PHP示例, VC运行库:http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf 新颖网络图片上传插件是一款简化图片上传操作的插件。它提供了一些灵活的配置,能够帮助用户快速搭建起一个强大的图片分享平台。通过这些配置,用户还可以非常方便的同时上传多张图片,或将图片以指定的格式上传,免去手动转换图片格式的烦恼。 在最新版的图片上传控件中采用了全新的网络数据传输模块,新的模块全面优化了网络层的数据处理代码,同时在接收服务器返回的数据代码中采用精确识别的方式使数据处理效率更高。这些改进使图片上传控件具有了闪电般的上传速度。现在新颖网络图片上传控件在上传图片时平均每张图片帮助用户节省了50%的时间。 相信新颖网络图片上传控件能够为您的应用带来更好的用户体验。 产品特点如下: 1. 基于标准HTTP协议。 2. 支持BMP,JPG,GIF,PNG图片格式。 3. 支持自动生成缩略图。 4. 支持文件批量上传。 5. 支持文件拖拽操作。 6. 支持自定义上传信息。 7. 快速编辑。旋转操作。 8. 显示上传进度。 9. 支持文件格式批量转换。 10. 支持打开默认文件夹功能。 11. 免费提供JavaScript SDK包,方便您将插件快速集成到已有网站中。 支持语言:PHP,JSP,ASP,ASP.NET(C#),ASP.NET(VB),C++,VC,VC.NET,VB,VB.NET,C#,C#.NET,Delphi,C++Builder 支持平台:Visual Studio 6.0/2002/2003/2005/2008/2010,C++ Builder 6.0/2009/2010,Delphi 7/2009,Visual Basic 6.0/2008 支持脚本:JavaScript,VBScript 支持系统:Windows NT,Windows 2003,Windows XP,Windows Vista,Windows 7,Linux 支持浏览器:IE6,IE7,IE8,IE8(x64),IE9(x64),Firefox,Chrome,360安全浏览器,360极速浏览器,Maxthon1.x,Maxthon2.x,Maxthon3.x,QQ浏览器 支持图片格式:BMP,GIF,JPG,PNG,TIF

28,391

社区成员

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

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