<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<script src="<?=base_url().'js/swfupload/swfupload.js'?>" type="text/javascript">
</script>
<title>Upload Form
</title>
</head>
<script type="text/javascript">
var swfu;
window.onload = function() {
var settings = {
flash_url : "
<?=base_url().'js/swfupload/swfupload.swf'?>",
upload_url: "
<?=site_url('upload/do_upload')?>",
file_size_limit : "100 MB",
file_types : "*.jpg;*.png;*.gif",
file_types_description : "图片文件",
file_post_name : 'upload',
prevent_swf_caching : false,
file_upload_limit : 100,
file_queue_limit : 1,
debug: true,
// Button settings
button_image_url: "
<?=base_url().'js/swfupload/XPButtonUploadText.png'?>",
button_width: "64",
button_height: "29",
button_placeholder_id: "upload",
button_text: '
<span class="theFont">上传
</span>',
button_text_style: ".theFont { font-size: 16; }",
button_text_left_padding: 12,
button_text_top_padding: 3,
// The event handler functions are defined in handlers.js
//file_queued_handler : function(){
//file_queue_error_handler : fileQueueError,
//file_dialog_complete_handler : fileDialogComplete,
//upload_start_handler : function(){
//upload_progress_handler : function(){alert('strat');},
file_dialog_complete_handler : function(){this.startUpload();},
//upload_error_handler : function(){alert('error');},
upload_success_handler : function(file,serverData){alert(serverData);},
//upload_complete_handler : uploadComplete,
//queue_complete_handler : queueComplete // Queue plugin event
};
swfu = new SWFUpload(settings);
};
function upload()
{
swfu.startUpload();
return true;
}
</script>
<body>
<?php echo $error;?>
<?php echo form_open_multipart('upload/do_upload');?>
<input type="file" name="upload" id='upload' size="20" />
<br /><br />
<input type="submit" value="upload" />
</form>
</body>
</html>