惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
SecWiki News
SecWiki News
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
量子位
M
MIT News - Artificial intelligence
GbyAI
GbyAI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
TaoSecurity Blog
TaoSecurity Blog
博客园 - 【当耐特】
H
Heimdal Security Blog
腾讯CDC
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News: Ask HN
Hacker News: Ask HN
S
Schneier on Security
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
博客园 - 司徒正美
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Cybersecurity and Infrastructure Security Agency CISA
S
SegmentFault 最新的问题
大猫的无限游戏
大猫的无限游戏
Application and Cybersecurity Blog
Application and Cybersecurity Blog
F
Full Disclosure
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Threatpost
月光博客
月光博客
A
Arctic Wolf
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
T
Troy Hunt's Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
D
DataBreaches.Net
O
OpenAI News
L
LINUX DO - 最新话题
宝玉的分享
宝玉的分享
小众软件
小众软件
V
Vulnerabilities – Threatpost
A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
T
The Exploit Database - CXSecurity.com
Martin Fowler
Martin Fowler
美团技术团队
P
Privacy International News Feed

博客园 - 李超@hicc

r与java整合(转) SVG路径字符串格式 java统计代码小工具 google fonts ie9下对html5的修复 js和jquery求table的列和 xmlHttpRequest的五种状态 JAVA实现逆波兰转换 顺排文档中逻辑树展开法的部分代码实现 页面且换时的效果 - 李超@hicc - 博客园 在线生成AJAX素材图片 将汉字转化为汉语拼音的小工具 无聊了,恶搞一下,程序员每天必须开的页面 防盗链原理 利用commonsfileupload+ffmpeg+mencoder完成视频的上传与转换(2) JAVA实现精确的加减乘除 通过jdbc 连接 Access - 李超@hicc Struts2&Jquery 新闻发布 使用AjaxTags实现自动完成
JAVA上传文件进度条的实现
李超@hicc · 2009-08-03 · via 博客园 - 李超@hicc

很久不在这里发帖子了,最近在家闲来无事,想到转视频的那东西又要做了,遂翻出以前的帖子,看到一年前丰哥让我做一下文件上传的进度条....额~~那就做一下吧。

东西很简单,主要用到commons-fileupload,其中有一个progressListener的接口,该接口可以实现实时更新已上传文件的大小,有了这个还说什么呢?

给出代码

代码

然后在上传得servlet或action中加入这样一段代码,就可以把自定义的progressListener添加进去

代码

最后就是通过js来不断的访问另一个servlet来实时返回上传状态就可以了,限于篇幅我就不再贴代码了,有兴趣的读者可以自己下载来看。

 代码下载(目标另存为就行了)