Menu

[r647]: / swfupload / trunk / demos / multiuploaddemo / index.php  Maximize  Restore  History

Download this file

157 lines (138 with data), 5.9 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
session_start();
if (count($_FILES)) {
// Handle degraded form uploads here. Degraded form uploads are POSTed to index.php. SWFUpload uploads
// are POSTed to upload.php
}
?>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>SWFUpload v2.0 Demo</title>
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../swfupload/swfupload.js"></script>
<script type="text/javascript" src="js/swfupload.graceful_degradation.js"></script>
<script type="text/javascript" src="js/swfupload.queue.js"></script>
<script type="text/javascript" src="js/handlers.js"></script>
<script type="text/javascript">
var upload1, upload2;
window.onload = function() {
upload1 = new SWFUpload({
// Backend Settings
upload_url: "../multiuploaddemo/upload.php", // Relative to the SWF file (or you can use absolute paths)
post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},
// File Upload Settings
file_size_limit : "102400", // 100MB
file_types : "*.*",
file_types_description : "All Files",
file_upload_limit : "10",
file_queue_limit : "0",
// Event Handler Settings (all my handlers are in the Handler.js file)
file_dialog_start_handler : fileDialogStart,
file_queued_handler : fileQueued,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_start_handler : uploadStart,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete,
// Flash Settings
flash_url : "../swfupload/swfupload_f8.swf", // Relative to this file (or you can use absolute paths)
swfupload_element_id : "flashUI1", // Setting from graceful degradation plugin
degraded_element_id : "degradedUI1", // Setting from graceful degradation plugin
custom_settings : {
progressTarget : "fsUploadProgress1",
cancelButtonId : "btnCancel1"
},
// Debug Settings
debug: false
});
upload2 = new SWFUpload({
// Backend Settings
upload_url: "../multiuploaddemo/upload.php", // Relative to the SWF file (or you can use absolute paths)
post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},
// File Upload Settings
file_size_limit : "200", // 200 kb
file_types : "*.jpg;*.gif;*.png",
file_types_description : "Image Files",
file_upload_limit : "10",
file_queue_limit : "2",
// Event Handler Settings (all my handlers are in the Handler.js file)
file_dialog_start_handler : fileDialogStart,
file_queued_handler : fileQueued,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_start_handler : uploadStart,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete,
// Flash Settings
flash_url : "../swfupload/swfupload_f8.swf", // Relative to this file (or you can use absolute paths)
swfupload_element_id : "flashUI2", // Setting from graceful degradation plugin
degraded_element_id : "degradedUI2", // Setting from graceful degradation plugin
custom_settings : {
progressTarget : "fsUploadProgress2",
cancelButtonId : "btnCancel2"
},
// Debug Settings
debug: false
});
}
</script>
</head>
<body>
<div class="title"><a class="likeParent" href="../index.php">SWFUpload v2.0 Multi-Upload Demo</a></div>
<form id="form1" action="index.php" method="post" enctype="multipart/form-data">
<div>This page demonstrates how multiple instances of SWFUpload can be loaded on the same page.
It also demonstrates the use of the graceful degradation plugin and the queue plugin.</div>
<div class="content">
<table>
<tr valign="top">
<td>
<div id="flashUI1" style="display: none;">
<fieldset class="flash" id="fsUploadProgress1">
<legend>Large File Upload Site</legend>
</fieldset>
<div>
<input type="button" value="Upload file (Max 100 MB)" onclick="upload1.selectFiles()" style="font-size: 8pt;" />
<input id="btnCancel1" type="button" value="Cancel Uploads" onclick="cancelQueue(upload1);" disabled="disabled" style="font-size: 8pt;" /><br />
</div>
</div>
<div id="degradedUI1">
<fieldset>
<legend>Large File Upload Site</legend>
<input type="file" name="anyfile1" /> (Any file, Max 100 MB)<br/>
</fieldset>
<div>
<input type="submit" value="Submit Files" />
</div>
</div>
</td>
<td>
<div id="flashUI2" style="display: none;">
<fieldset class="flash" id="fsUploadProgress2">
<legend>Small File Upload Site</legend>
</fieldset>
<div>
<input type="button" value="Upload file (Max 200KB)" onclick="upload2.selectFiles()" style="font-size: 8pt;" />
<input id="btnCancel2" type="button" value="Cancel Uploads" onclick="cancelQueue(upload2);" disabled="disabled" style="font-size: 8pt;" /><br />
</div>
</div>
<div id="degradedUI2">
<fieldset>
<legend>Small File Upload Site</legend>
<input type="file" name="anyfile2" /> (Any file, Max 200KB)<br/>
</fieldset>
<div>
<input type="submit" value="Submit Files" />
</div>
</div>
</td>
</tr>
</table>
</div>
</form>
</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.