<%@ page contenttype= "Text/html;charset=utf-8"%>
<%
Double permaxsize = 1.5;//The max size allowed for a single file
String sizeunit = "MB";//permaxsize data corresponding units
String ext = "*.jpg;*.jpeg;*.gif";//allowed file types to be uploaded
Target page for file upload submission
StringBuffer uploadurl = new StringBuffer ("http://");
Uploadurl.append (Request.getheader ("Host"));
Uploadurl.append (Request.getcontextpath ());
Uploadurl.append ("/admin/swfuploadexample/uploadfileexamplesubmit.jsp tutorial");
%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
<title> Bulk Photo Upload </title>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<link href= "CSS tutorial/default.css" rel= "stylesheet" type= "Text/css"/>
<script type= "Text/javascript tutorial" src= "Js/swfupload.js" ></script>
<script type= "Text/javascript" src= "Js/swfupload.swfobject.js" ></script>
<script type= "Text/javascript" src= "Js/swfupload.queue.js" ></script>
<script type= "Text/javascript" src= "Js/fileprogress.js" ></script>
<script type= "Text/javascript" src= "Js/handlers.js" ></script>
<script type= "Text/javascript" >
var swfu;
Swfupload.onload = function () {
var settings = {
Flash_url: "Js/swfupload.swf",
Upload_url: "<%=uploadurl.tostring ()%>",
Post_params: {
"user_id": "stephen830",
"pass_id": "123456"
},
File_size_limit: "<%=perMaxSize%> <%=sizeUnit%>",
File_Types: "<%=ext%>",
File_types_description: "<%=ext%>",
FILE_UPLOAD_LIMIT:100,
file_queue_limit:0,
Custom_settings: {
Progresstarget: "Fsuploadprogress",
Cancelbuttonid: "Btncancel",
Uploadbuttonid: "Btnupload",
Myfilelisttarget: "Idfilelist"
},
Debug:false,
Auto_upload:false,
Button Settings
Button_image_url: "Images/xpbuttonuploadtext_61x22.png",//relative to the SWF file
button_placeholder_id: "Spanbuttonplaceholder",
Button_width:61,
Button_height:22,
The event handler functions are defined in Handlers.js
Swfupload_loaded_handler:swfuploadloaded,
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,
Queue_complete_handler:queuecomplete,//Queue plugin Event
SWFObject settings
Minimum_flash_version: "9.0.28",
Swfupload_pre_load_handler:swfuploadpreload,
Swfupload_load_failed_handler:swfuploadloadfailed
};
SWFU = new SWFUpload (settings);
}