test.jsp
4.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!--DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>上传测试</title>
<link rel="stylesheet" type="text/css" href="/js/extjs/resources/css/ext-all_wev8.css" />
<script type="text/javascript" src="/js/extjs/adapter/ext/ext-base_wev8.js"></script>
<script type="text/javascript" src="/js/extjs/ext-all_wev8.js"></script>
<!-- Files needed for SwfUploaderPanel -->
<link rel="stylesheet" type="text/css" href="/js/extjs/source/ux/SwfUploadPanel/SwfUploadPanel_wev8.css" />
<script type="text/javascript" src="/js/extjs/source/ux/SwfUploadPanel/SwfUpload_wev8.js"></script>
<script type="text/javascript" src="/js/extjs/source/ux/SwfUploadPanel/SwfUploadPanel_wev8.js"></script>
<script>
Ext.onReady(function() {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g,"");
}
// Get SessionId from cookie
var PHPSESSIDX = null;
var cookies = document.cookie.split(";");
Ext.each(cookies, function(cookie) {
var nvp = cookie.split("=");
if (nvp[0].trim() == 'PHPSESSID')
PHPSESSIDX = nvp[1];
});
var uploader = new Ext.ux.SwfUploadPanel({
title: '多文档上传'
, renderTo: 'grid'
, width: 600
, height: 300
// Uploader Params
, upload_url: '/docs/docupload/MultiDocUpload.jsp'
// , upload_url: 'http://localhost/www.silverbiology.com/ext/plugins/SwfUploadPanel/upload_example.php'
, post_params: { PHPSESSIDX: PHPSESSIDX }
<%
//if (isset($_REQUEST[debug])) print ", debug: true";
%>
, flash_url: "/js/extjs/source/ux/SwfUploadPanel/swfupload_f9.swf"
// , single_select: true // Select only one file from the FileDialog
// Custom Params
, single_file_select: false // Set to true if you only want to select one file from the FileDialog.
, confirm_delete: false // This will prompt for removing files from queue.
, remove_completed: false // Remove file from grid after uploaded.
});
uploader.on('swfUploadLoaded', function() {
this.addPostParam( 'Post1', 'example1' );
});
uploader.on('fileUploadComplete', function(panel, file, response) {
});
uploader.on('queueUploadComplete', function() {
if ( Ext.isGecko ) {
console.log("Files Finished");
} else {
alert("Files Finished");
}
});
/*var btn = new Ext.Button({
text: 'Launch Sample Uploader'
, renderTo: 'btn'
, handler: function() {
var dlg = new Ext.ux.SwfUploadPanel({
title: 'Dialog Sample'
, width: 500
, height: 300
, border: false
// Uploader Params
, upload_url: 'http://www.silverbiology.com/ext/plugins/SwfUploadPanel/upload_example.php'
// , upload_url: 'http://localhost/www.silverbiology.com/ext/plugins/SwfUploadPanel/upload_example.php'
, post_params: { id: 123}
, file_types: '*.jpg'
, file_types_description: 'Image Files'
<%
//if (isset($_REQUEST[debug])) print ", debug: true";
%>
, flash_url: "/js/extjs/source/ux/SwfUploadPanel/swfupload_f9.swf"
// , single_select: true // Select only one file from the FileDialog
// Custom Params
, single_file_select: false // Set to true if you only want to select one file from the FileDialog.
, confirm_delete: false // This will prompt for removing files from queue.
, remove_completed: true // Remove file from grid after uploaded.
}); // End Dialog
var win = new Ext.Window({
title: 'Window'
, width: 514
, height: 330
, resizable: false
, items: [ dlg ]
}); // End Window
win.show();
} // End Btn Handler
}); // end Btn*/
});
</script>
<style type="text/css">
<!--
.style1 {
font-weight: bold
}
body, td, th {
font-family: Arial, Helvetica, sans-serif;
}
body {
margin-left: 5px;
margin-top: 5px;
margin-right: 5px;
margin-bottom: 5px;
}
.style3 {font-size: 10px; font-style: italic;}
-->
</style>
</head>
<body>
<div id="grid"></div>
<br>
<!--<div id="btn"></div>-->
</body>
</html>