Menu

[r766]: / swfupload / trunk / samples / demos / featuresdemo / index.php  Maximize  Restore  History

Download this file

311 lines (303 with data), 11.4 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>SWFUpload Demos - Features Demo</title>
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<link href="css/featuresdemo.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../swfupload/swfupload.js"></script>
<script type="text/javascript" src="js/featuresdemo.js"></script>
<script type="text/javascript" src="js/handlers.js"></script>
<script type="text/javascript">
var suo;
window.onload = function() {
// Check to see if SWFUpload is available
if (typeof(SWFUpload) === "undefined") {
return;
}
// Instantiate a SWFUpload Instance
suo = new SWFUpload({
// Backend Settings
upload_url: "../featuresdemo/upload.php?get_name=get_value", // I can pass query strings here if I want
use_query_string : false,
post_params: { "post_name1": "post_value1", "post_name2": "post_value2" }, // Here are some POST values to send. These can be changed dynamically
file_post_name: "Filedata", // This is the "name" of the file item that the server-side script will receive. Setting this doesn't work in the Linux Flash Player
requeue_on_error: false,
// File Upload Settings
file_size_limit : "100 MB",
file_types : "*.*",
file_types_description : "All Files",
file_upload_limit : "10",
// Event Handler Settings
swfupload_loaded_handler : FeaturesDemoHandlers.swfUploadLoaded,
file_dialog_start_handler : FeaturesDemoHandlers.fileDialogStart,
file_queued_handler : FeaturesDemoHandlers.fileQueued,
file_queue_error_handler : FeaturesDemoHandlers.fileQueueError,
file_dialog_complete_handler : FeaturesDemoHandlers.fileDialogComplete,
upload_start_handler : FeaturesDemoHandlers.uploadStart,
upload_progress_handler : FeaturesDemoHandlers.uploadProgress,
upload_error_handler : FeaturesDemoHandlers.uploadError,
upload_success_handler : FeaturesDemoHandlers.uploadSuccess,
upload_complete_handler : FeaturesDemoHandlers.uploadComplete,
debug_handler : FeaturesDemoHandlers.debug,
// Flash Settings
flash_url : "../swfupload/swfupload_f9.swf", // Relative to this file
// Debug Settings
debug: true // For the purposes of this demo I wan't debug info shown
});
};
</script>
</head>
<body>
<div id="header">
<h1 id="logo"><a href="../">SWFUpload</a></h1>
<div id="version">v2.1.0</div>
</div>
<div id="content">
<h2>Features Demo</h2>
<form>
The Features Demo allows you to experiment with all the features and settings that SWFUpload v2.0 offers.<br />
<br />
You can change all the settings except 'upload_url'.<br />
<br />
<strong>Your PHP Session ID is <?php echo session_id(); ?>.</strong> This is provided so you can see the Flash Player Cookie
bug in action. Compare this Session ID to the Session ID and Cookies displayed in the Server Data section
after an upload is complete (SWFUpload FP9 only).<br />
<br />
SWFUpload has <span id="spanLoadStatus" style="font-weight: bold;">not loaded</span><br />
<table class="layout">
<tr>
<td style="width: 316px;"><fieldset>
<legend>Queue</legend>
<div>
<select id="selQueue" size="15" style="width: 270px;">
</select>
</div>
<div>
<table class="btn">
<tr>
<td class="btn-left"></td>
<td class="btn-center"><button id="btnBrowseSingle" type="button" class="action">Select Single File...</button></td>
<td class="btn-right"></td>
</tr>
</table>
</div>
<div>
<table class="btn">
<tr>
<td class="btn-left"></td>
<td class="btn-center"><button id="btnBrowse" type="button" class="action">Select Files...</button></td>
<td class="btn-right"></td>
</tr>
</table>
</div>
<div>
<table class="btn">
<tr>
<td class="btn-left"></td>
<td class="btn-center"><button id="btnStartSelectedFile" type="button" class="action">Start Selected File</button></td>
<td class="btn-right"></td>
</tr>
</table>
</div>
<div>
<table class="btn">
<tr>
<td class="btn-left"></td>
<td class="btn-center"><button id="btnStopUpload" type="button" class="action">Stop Upload</button></td>
<td class="btn-right"></td>
</tr>
</table>
</div>
<div>
<table class="btn">
<tr>
<td class="btn-left"></td>
<td class="btn-center"><button id="btnCancelSelectedFile" type="button" class="action">Cancel Selected File</button></td>
<td class="btn-right"></td>
</tr>
</table>
</div>
</fieldset></td>
<td style="width: 316px;"><fieldset>
<legend>Post Params</legend>
<div>
<label for="txtAddFileParamName"><strong>File Post Param</strong> (Select a file first)</label>
<div style="margin-left: 10px; margin-bottom: 10px;">
<table>
<tr>
<td></td>
<td><strong>Name</strong></td>
<td><strong>Value</strong></td>
<td></td>
</tr>
<tr>
<td style="vertical-align: middle; text-align: right;">Add:</td>
<td><input id="txtAddFileParamName" type="text" class="textbox" style="width: 100px;" />
</td>
<td><input id="txtAddFileParamValue" type="text" class="textbox" style="width: 100px;" />
</td>
<td><button id="btnAddFileParam" type="button"></button></td>
</tr>
<tr>
<td style="vertical-align: middle;">Remove:</td>
<td><input id="txtRemoveFileParamName" type="text" class="textbox" style="width: 100px;" /></td>
<td><button id="btnRemoveFileParam" type="button"></button></td>
<td></td>
</tr>
</table>
</div>
</div>
<label for="txtAddParamName" style="font-weight: bolder;">Global Post Params</label>
<div style="margin-left: 10px;">
<div>
<select id="selParams" size="5">
</select>
<button id="btnRemoveParam" type="button"></button>
</div>
<table>
<tr>
<td></td>
<td><strong>Name</strong></td>
<td><strong>Value</strong></td>
<td></td>
</tr>
<tr>
<td style="vertical-align: middle;">Add:</td>
<td><input id="txtAddParamName" type="text" class="textbox" />
</td>
<td><input id="txtAddParamValue" type="text" class="textbox" />
</td>
<td><button id="btnAddParam" type="button"></button></td>
</tr>
</table>
</div>
</fieldset>
<fieldset>
<legend>Instance Information</legend>
<div>
<label for="txtMovieName">movieName</label>
<input id="txtMovieName" type="text" class="textbox" />
</div>
<div>
<label for="txtFlashHTML">Flash HTML</label>
<textarea id="txtFlashHTML" wrap="soft" style="height: 100px;"></textarea>
</div>
</fieldset></td>
<td style="width: 316px;"><fieldset>
<legend>Dynamic Settings</legend>
<div id="divDynamicSettingForm">
<div>
<label for="txtUploadTarget">upload_url:</label>
<input id="txtUploadTarget" type="text" class="textbox" />
</div>
<div>
<label for="txtFilePostName">file_post_name</label>
<input id="txtFilePostName" type="text" class="textbox" />
</div>
<div>
<label for="txtFileTypes">file_types</label>
<input id="txtFileTypes" type="text" class="textbox" />
</div>
<div>
<label for="txtFileTypesDescription">file_types_description</label>
<input id="txtFileTypesDescription" type="text" class="textbox" />
</div>
<div>
<label for="txtFileSizeLimit">file_size_limit</label>
<input id="txtFileSizeLimit" type="text" class="textbox" />
</div>
<div>
<label for="txtFileUploadLimit">file_upload_limit</label>
<input id="txtFileUploadLimit" type="text" class="textbox" />
</div>
<div>
<label for="txtFileQueueLimit">file_queue_limit</label>
<input id="txtFileQueueLimit" type="text" class="textbox" />
</div>
<div class="checkbox">
<input id="cbUseQueryString" type="checkbox" />
<label for="cbUseQueryString">use_query_string</label>
</div>
<div class="checkbox">
<input id="cbRequeueOnError" type="checkbox" />
<label for="cbRequeueOnError">requeue_on_error</label>
</div>
<div class="checkbox">
<input id="cbDebug" type="checkbox" />
<label for="cbDebug">debug</label>
</div>
</div>
<div>
<table class="btn">
<tr>
<td class="btn-left"></td>
<td class="btn-center"><button id="btnUpdateDynamicSettings" type="button">Update Dynamic Settings</button></td>
<td class="btn-right"></td>
</tr>
</table>
</div>
</fieldset>
<fieldset id="fsStaticSettings">
<legend>Static Settings</legend>
<div>
<label>flash_url</label>
<input type="radio" name="flash_url" id="rbFlash8" style="width: auto; vertical-align: middle;" />
<label style="float: none; width: auto; display: inline;" for="rbFlash8">SWFUpload FP8</label>
<br />
</div>
<div>
<label for="txtFlashURL"></label>
<input type="radio" name="flash_url" id="rbFlash9" style="width: auto; vertical-align: middle;" />
<label style="float: none; width: auto; display: inline;" for="rbFlash9">SWFUpload FP9</label>
<br />
</div>
<div>
<label for="txtFlashColor">flash_color</label>
<input id="txtFlashColor" type="text" class="textbox" />
</div>
<div>
<table class="btn">
<tr>
<td class="btn-left"></td>
<td class="btn-center"><button id="btnReloadSWFUpload" type="button">Reload SWFUpload</button></td>
<td class="btn-right"></td>
</tr>
</table>
</div>
</fieldset></td>
</tr>
<tr>
<td colspan="3"><fieldset>
<legend>Events</legend>
<table style="width: 100%;">
<tr>
<td style="width: 50%"><div>
<label for="selEventsQueue">Queue</label>
<select id="selEventsQueue" size="10" style="width: 100%;">
</select>
</div></td>
<td style="width: 50%; overflow: hidden;"><div>
<label for="selEventsFile">File</label>
<select id="selEventsFile" size="10" style="width: 100%;">
</select>
</div></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>Debug</legend>
<div>
<textarea id="SWFUpload_Console" wrap="off"></textarea>
</div>
</fieldset>
<fieldset>
<legend>Server Data</legend>
<div id="divServerData"></div>
</fieldset></td>
</tr>
</table>
</form>
</div>
</body>
</html>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.