Menu

[r462]: / swfupload / trunk / demos / formsdemo / index.php  Maximize  Restore  History

Download this file

145 lines (131 with data), 4.8 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
<?php
session_start();
$_SESSION["resume_name"] = "";
?>
<!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 Revision 5 Demo</title>
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../swfuploadr52_0002/swfupload.js"></script>
<script type="text/javascript" src="js/handlers.js"></script>
<script type="text/javascript">
var swf_upload_control;
window.onload = function () {
swf_upload_control = new SWFUpload({
// Backend settings
upload_target_url: "../formsdemo/upload.php", // Relative to the SWF file
upload_cookies: ["PHPSESSID"],
// Flash file settings
file_size_limit : "10240", // 10 MB
file_types : "*.*", // or you could use something like: "*.doc;*.wpd;*.pdf",
file_types_description : "All Files",
file_upload_limit : "1",
//file_queue_limit : "1", // this isn't needed because the upload_limit will automatically place a queue limit
begin_upload_on_queue : false,
// Event handler settings
file_queued_handler : fileQueued,
file_progress_handler : fileProgress,
file_cancelled_handler : uploadCancelled,
file_complete_handler : fileComplete,
queue_complete_handler : queueComplete,
error_handler : uploadError,
// Flash Settings
flash_container_element : "flashContainer",
flash_url : "../swfuploadr52_0002/swfupload.swf", // Relative to this file
// UI settings
ui_container_id : "flashUI",
degraded_container_id : "degradedUI",
// Debug settings
debug: true
});
// This is a setting that my Handlers will use. It's not part of SWFUpload
// But I can add it to the SWFUpload object and then use it where I need to
swf_upload_control.addSetting("progress_target", "fsUploadProgress")
}
// Called by the submit button to start the upload
function doSubmit() {
try {
var btnBrowse = document.getElementById("btnBrowse");
btnBrowse.disabled = true;
swf_upload_control.StartUpload();
} catch (ex) {}
}
// Called by the queue complete handler to submit the form
function uploadDone() {
try {
document.forms[0].submit();
} catch (ex) {}
}
</script>
</head>
<body>
<div class="title"><a class="likeParent" href="../index.php">SWFUpload (Revision 5) Classic Form Demo</a></div>
<form id="form1" action="thanks.php" enctype="multipart/form-data" method="post">
<div class="content">
<fieldset >
<legend>Submit your Application</legend>
<table style="vertical-align:top;">
<tr>
<td>
Last Name:
</td>
<td>
<input name="lastname" type="text" style="width: 200px" />
</td>
</tr>
<tr>
<td>
First Name:
</td>
<td>
<input name="firstname" type="text" style="width: 200px" />
</td>
</tr>
<tr>
<td>
Education:
</td>
<td>
<textarea name="education" cols="0" rows="0" style="width: 400px; height: 100px;"></textarea>
</td>
</tr>
<tr>
<td>
Resume:
</td>
<td>
<div id="flashUI" style="display: none;">
<!-- The UI only gets displayed if SWFUpload loads properly -->
<div>
<input type="text" id="txtFileName" disabled="true" style="border: solid 1px; background-color: #FFFFFF;" /><input id="btnBrowse" type="button" value="Browse..." onclick="fileBrowse.apply(swf_upload_control)" /> (10 MB max)
</div>
<div class="flash" id="fsUploadProgress">
<!-- This is where the file progress gets shown. SWFUpload doesn't update the UI directly.
The Handlers (in handlers.js) process the upload events and make the UI updates -->
</div>
</div>
<div id="degradedUI">
<!-- This is the standard UI. This UI is shown by default but when SWFUpload loads it will be
hidden and the "flashUI" will be shown -->
<input type="file" name="resume" /> (10 MB max)<br/>
</div>
<div id="flashContainer"><!-- This is where the flash embed/object tag will go once SWFUpload has loaded --></div>
</td>
</tr>
<tr>
<td>
References:
</td>
<td>
<textarea name="references" cols="0" rows="0" style="width: 400px; height: 100px;"></textarea>
</td>
</tr>
</table>
<br />
<input type="submit" value="Submit Application" onclick="doSubmit(); return false;" />
</fieldset>
</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.