- 浏览: 2539860 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
SwfUpload(1)swf multiple files uploading example
swfUpload need flash player. It is good and easy to use.
My action is as follow:
@RequestMapping(value = "/swfupload.do", method = RequestMethod.POST)
public void swfupload(
@RequestParam(value = "fileName", required = false) String fileName,
@RequestParam(value = "Filedata") MultipartFile file,
HttpServletResponse response) throws IOException {
logger.info("swf orginal file name = " + file.getOriginalFilename()
+ " fileName = " + fileName);
PrintWriter out = response.getWriter();
response.setContentType("text/html;charset=UTF-8");
response.setCharacterEncoding("UTF-8");
out.write("{success:true}");
out.close();
}
My example is in easytalker project.
The html page will be as follow:
<html>
<head>
<title>SWFUpload Demo</title>
<link rel="stylesheet" type="text/css" href="./resources/component/swfupload/2.2.0.1/default.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="./resources/component/swfupload/2.2.0.1/swfupload.js"></script>
<script type="text/javascript" src="./resources/component/swfupload/2.2.0.1/swfupload.queue.js"></script>
<script type="text/javascript" src="./resources/component/swfupload/2.2.0.1/fileprogress.js"></script>
<script type="text/javascript" src="./resources/component/swfupload/2.2.0.1/handlers.js"></script>
<script type="text/javascript">
var swfupload;
$(function(){
var settings = {
flash_url : "./resources/component/swfupload/2.2.0.1/swfupload.swf",
flash9_url : "./resources/component/swfupload/2.2.0.1/swfupload_fp9.swf",
upload_url: "swfupload.do",
file_size_limit : "100 MB",
file_types : "*.*",
file_types_description : "All Files",
file_upload_limit : 100,
file_queue_limit : 0,
custom_settings : {
cancelButtonId : "btnCancel",
progressTarget : "fsUploadProgress"
},
debug: false,
// Button settings
button_image_url: "./resources/component/swfupload/2.2.0.1/XPButtonUploadText_61x22.png",
button_width: "80",
button_height: "22",
button_placeholder_id: "spanButtonPlaceHolder",
button_text: '<span class="theFont">Add File</span>',
button_text_style: ".theFont { font-size: 12; }",
button_text_left_padding: 4,
button_text_top_padding: 3,
// The event handler functions are defined in handlers.js
swfupload_preload_handler : preLoad,
swfupload_load_failed_handler : loadFailed,
file_queued_handler : fileQueued,
file_queue_error_handler : fileQueueError,//select file error
file_dialog_complete_handler : fileDialogComplete,//after selecting file
upload_start_handler : uploadStart,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,//upload fail
upload_success_handler : uploadSuccess,//upload success
upload_complete_handler : uploadComplete,//file upload complete
queue_complete_handler : queueComplete // Queue plugin event
};
swfupload = new SWFUpload(settings);
});
</script>
</head>
<body>
<div><span id="attachment">file:</span></div>
<div>
<span id="spanButtonPlaceHolder"></span>
<input id="btnCancel" type="button" value="Cancel" onclick="swfupload.cancelQueue();" disabled="disabled"/>
<span id="divStatus">files uploaded</span>
</div>
<div id="fsUploadProgress"></div>
</body>
</html>
The most import javascript files are
handlers.js
my file are very simple, I delete a lot of functions in previous example. I just want to verify the file uploading function.
At first, I want to response the client json format data in json reponse. But I got 406 error.
HTML 406 Not Acceptable error on upload
So I change the response to application-context/text/html, It is ok now.
This is the answer about this in official website:
A regular browser doing an upload will accept results in these types: (taken from
actual headers)
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
references:
http://www.iteye.com/topic/1123391
http://www.iteye.com/topic/1123990
http://code.google.com/p/swfupload/
http://demo.swfupload.org/v220/index.htm
https://github.com/lardawge/swfupload-rails-authentication/issues/1
http://code.google.com/p/activeupload/issues/detail?id=2
swfUpload need flash player. It is good and easy to use.
My action is as follow:
@RequestMapping(value = "/swfupload.do", method = RequestMethod.POST)
public void swfupload(
@RequestParam(value = "fileName", required = false) String fileName,
@RequestParam(value = "Filedata") MultipartFile file,
HttpServletResponse response) throws IOException {
logger.info("swf orginal file name = " + file.getOriginalFilename()
+ " fileName = " + fileName);
PrintWriter out = response.getWriter();
response.setContentType("text/html;charset=UTF-8");
response.setCharacterEncoding("UTF-8");
out.write("{success:true}");
out.close();
}
My example is in easytalker project.
The html page will be as follow:
<html>
<head>
<title>SWFUpload Demo</title>
<link rel="stylesheet" type="text/css" href="./resources/component/swfupload/2.2.0.1/default.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="./resources/component/swfupload/2.2.0.1/swfupload.js"></script>
<script type="text/javascript" src="./resources/component/swfupload/2.2.0.1/swfupload.queue.js"></script>
<script type="text/javascript" src="./resources/component/swfupload/2.2.0.1/fileprogress.js"></script>
<script type="text/javascript" src="./resources/component/swfupload/2.2.0.1/handlers.js"></script>
<script type="text/javascript">
var swfupload;
$(function(){
var settings = {
flash_url : "./resources/component/swfupload/2.2.0.1/swfupload.swf",
flash9_url : "./resources/component/swfupload/2.2.0.1/swfupload_fp9.swf",
upload_url: "swfupload.do",
file_size_limit : "100 MB",
file_types : "*.*",
file_types_description : "All Files",
file_upload_limit : 100,
file_queue_limit : 0,
custom_settings : {
cancelButtonId : "btnCancel",
progressTarget : "fsUploadProgress"
},
debug: false,
// Button settings
button_image_url: "./resources/component/swfupload/2.2.0.1/XPButtonUploadText_61x22.png",
button_width: "80",
button_height: "22",
button_placeholder_id: "spanButtonPlaceHolder",
button_text: '<span class="theFont">Add File</span>',
button_text_style: ".theFont { font-size: 12; }",
button_text_left_padding: 4,
button_text_top_padding: 3,
// The event handler functions are defined in handlers.js
swfupload_preload_handler : preLoad,
swfupload_load_failed_handler : loadFailed,
file_queued_handler : fileQueued,
file_queue_error_handler : fileQueueError,//select file error
file_dialog_complete_handler : fileDialogComplete,//after selecting file
upload_start_handler : uploadStart,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,//upload fail
upload_success_handler : uploadSuccess,//upload success
upload_complete_handler : uploadComplete,//file upload complete
queue_complete_handler : queueComplete // Queue plugin event
};
swfupload = new SWFUpload(settings);
});
</script>
</head>
<body>
<div><span id="attachment">file:</span></div>
<div>
<span id="spanButtonPlaceHolder"></span>
<input id="btnCancel" type="button" value="Cancel" onclick="swfupload.cancelQueue();" disabled="disabled"/>
<span id="divStatus">files uploaded</span>
</div>
<div id="fsUploadProgress"></div>
</body>
</html>
The most import javascript files are
handlers.js
my file are very simple, I delete a lot of functions in previous example. I just want to verify the file uploading function.
At first, I want to response the client json format data in json reponse. But I got 406 error.
HTML 406 Not Acceptable error on upload
So I change the response to application-context/text/html, It is ok now.
This is the answer about this in official website:
A regular browser doing an upload will accept results in these types: (taken from
actual headers)
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
references:
http://www.iteye.com/topic/1123391
http://www.iteye.com/topic/1123990
http://code.google.com/p/swfupload/
http://demo.swfupload.org/v220/index.htm
https://github.com/lardawge/swfupload-rails-authentication/issues/1
http://code.google.com/p/activeupload/issues/detail?id=2
发表评论
-
MongoDB 2019(3)Security and Auth
2019-11-16 06:48 232MongoDB 2019(3)Security and Aut ... -
Memory Leak in NodeJS
2018-12-20 06:26 723Memory Leak in NodeJS I have d ... -
Remote Desktop Client
2018-12-07 13:19 1186Remote Desktop Client There is ... -
MetaBase UI Console(2)Docker on MySQL
2018-11-29 06:58 939MetaBase UI Console(2)Docker on ... -
AWS Lambda and Serverless Timeout
2018-09-20 01:20 625AWS Lambda and Serverless Timeo ... -
2018 WebSocket(1)Introduction
2018-03-20 01:22 11032018 WebSocket(1)Introduction ... -
2018 TypeScript Update(3)Introduction Basic Grammar
2018-03-08 03:08 6002018 TypeScript Update(3)Introd ... -
2018 TypeScript Update(2)Introduction Basic Grammar - Classes and Functions
2018-03-06 05:32 5512018 TypeScript Update(2)Introd ... -
2018 TypeScript Update(1)Introduction Basic Grammar - Types and Interface
2018-03-03 01:15 5992018 TypeScript Update(1)Introd ... -
Charts and Console(6)Paging
2018-03-01 00:12 577Charts and Console(6)Paging Th ... -
Vue.JS(3)Google Login
2018-02-14 04:53 1296Vue.JS(3)Google Login I just p ... -
Vue.JS(2)Monitor Water Console - ChartJS and Axios
2018-02-14 03:17 718Vue.JS(2)Monitor Water Console ... -
Vue.JS(1)Introduction and Basic Demo
2018-02-08 06:47 604Vue.JS(1)Introduction and Basic ... -
Charts and Console(5)Validation Form
2017-10-03 05:12 804Charts and Console(5)Validation ... -
Charts and Console(4)Display and Enhancement
2017-09-20 05:39 631Charts and Console(4)Display an ... -
Charts and Console(3)Auth and Login
2017-09-13 03:45 659Charts and Console(3)Auth and L ... -
Charts and Console(2)Login and Proxy
2017-08-31 05:39 874Charts and Console(2)Login and ... -
Charts and Console(1)UI Console and RESTful Client
2017-08-29 11:02 766Charts and Console(1)UI Console ... -
Blog Project(2)Express Backend API - istanbul - mocha - bunyan
2017-06-09 00:05 473Blog Project(2)Express Backend ... -
ReactJS(5)Composition vs Inheritance
2017-06-06 05:55 1106ReactJS(5)Composition vs Inheri ...
相关推荐
*swfUpload/Flash/swfupload.swf?movieName=aaa"])}catch(e){(alert)(1)};// *解决swfupload-xss注入,自己项目中遇到的,已经修改 亲测通过 *将文件中的swf文件替换掉项目中的swf文件 *将swfupload.as文件替换掉...
1. **Flash技术**:SWFUpload基于Flash,因为Flash在早期提供了浏览器间文件上传的统一解决方案。它利用Flash的FileReference对象,可以跨浏览器上传大文件,并且支持多文件选择。 2. **JavaScript交互**:...
swfupload.swf和swfupload.js(调用flash的接口文件) 网上下载的swfupload.swf.v2.5.0.beta3.2.zip中一般只有swf文件,缺少js文件。 另附: swfupload.swf.v2.5.0.beta3.2.zip SWFUpload_v250_beta_3_samples.zip
extjs 3.x 批量上传文件用.在我的博客中写了具体怎么用。https://blog.csdn.net/somdip/article/details/89842350
1. **初始化设置**:SWFUpload 的使用始于创建一个实例,开发者需要配置各种参数,如上传URL、文件类型限制、最大上传文件大小等,然后通过JavaScript调用`SWFUpload.getInstance()`来实例化组件。 2. **事件处理**...
**1. 多文件选择和批量上传** SWFUpload 的核心特性之一就是支持多文件选择。用户可以通过浏览器的文件对话框一次性选择多个文件,然后通过SWFUpload进行批量上传,大大提升了用户交互体验和上传效率。这对于那些...
这个"swfupload.swf.v2.5.0.beta3.2版本"是该库的一个较新版本,提供了增强的功能和修复了一些已知问题。 在多文件上传领域,SWFUpload扮演着重要角色,尤其是在2000年代末期到2010年代初,那时HTML5的File API尚未...
1. **SWFUpload JavaScript文件**:这些文件定义了与SWFUpload交互的JavaScript API,如初始化、开始上传、监听事件等。 2. **Flash SWF文件**:这是实际执行文件上传操作的Flash组件。 3. **PHP处理脚本**:负责...
总的来说,这个"extjs3.x+swfupload.swf多文件上传终结版"是一个整合了ExtJS 3.x UI框架和SWFUpload技术的解决方案,旨在提供一个稳定、高效的多文件上传体验,且已经在VS2008环境中得到了验证。使用这样的组件,...
下载后,将SWFUpload的JavaScript文件和Flash对象(通常是`swfupload.swf`)包含到你的HTML页面中。确保设置正确的路径,以便浏览器能够找到它们。 ### 3. 初始化SWFUpload 在JavaScript中,你需要调用`SWFUpload`...
SWFUpload 是一款开源的Flash上传组件,广泛应用于网页中的文件上传功能。它允许用户在浏览器端通过Flash技术实现多文件选择、进度条显示、断点续传等高级上传功能,而无需离开当前页面,提高了用户体验。SWFUpload ...
环境:swfupload.swf+vs2010,上传大文件带进度条。 本人要网上找了好多上传文件带进度条的实例,担都不好用,写的都太复杂,这是本人按网上找的实例,写的一个简单的上传文件带进度条的,文件很小,功能却一点也不...
SWFUpload是一款优秀的JavaScript库,它允许用户通过Flash技术实现多文件选择和上传,提高了用户体验,尤其是在处理大文件时。这个"PHP多文件上传 SWFUpload上传例子"是一个演示如何将SWFUpload与PHP结合使用的示例...
`swfupload`目录可能存放的是Flash部分的源码和编译后的SWF文件。`preview`可能包含预览或演示SwfUpload功能的页面。最后,`plugins`目录可能包含了一些扩展功能,比如文件类型检查、多文件上传等插件。 总的来说,...
SWFUpload 的核心是Flash电影(SWF文件),这个电影负责与服务器进行实际的文件传输。JavaScript则用于处理用户交互,如触发文件选择对话框、控制上传过程、显示反馈信息等。在用户选择文件后,Flash电影将文件数据...
1. 引入SWFUpload的JavaScript库和Flash对象。 2. 创建上传按钮,通过JavaScript调用SWFUpload初始化。 3. 配置上传参数,如服务器端处理页面、文件类型等。 4. 处理上传事件,如文件选择、上传开始、上传完成等。 5...
1. **Flash Player支持**:SwfUpload依赖Flash Player运行,所以用户的浏览器必须安装并支持Flash Player 10或更高版本。尽管现代浏览器和移动设备倾向于HTML5,但SwfUpload在Flash支持的环境中仍能提供较好的文件...
在实际开发中,开发者需要下载SWFUpload v2.2.0.1 Core这个压缩包,解压后会包含SWFUpload的JavaScript库、Flash电影(.swf文件)、示例代码和文档,通过阅读文档和示例,可以快速了解如何在项目中使用这个组件。...
接下来,要添加SWFUpload功能,你需要下载SWFUpload库,这个库包含了一个Flash电影(SWF文件)和一组JavaScript文件。这些文件负责与Flash进行通信,实现文件选择、上传进度显示等功能。将SWFUpload库解压后,将所需...