日期:2014-05-17  浏览次数:20485 次

SWFUpload控件问题
最近项目中需要使用多文件上传,并将文件信息写入到数据库,将SWFUpload控件的Default.aspx文件修改如下:
----------------------------

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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 runat="server">
    <title>MultiUpload(ASP.Net 2.0)</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/handlers.js"></script>
<script type="text/javascript">
var swfu;
window.onload = function () {
swfu = new SWFUpload({
// Backend Settings
upload_url: "upload.aspx",
                post_params : {     //key-values will sand to server when file send to server; user can set it
                    "ASPSESSID"  : "<%=Session.SessionID %>"
                    //"PRODUCTTYPE": "NO DATA"
                },

// File Upload Settings
file_size_limit : "10 MB",
file_types : "*.zip; *.pdf; *.txt",
file_types_description : "Source File",
file_upload_limit : "0",    // Zero means unlimited

// Event Handler Settings - these functions as defined in Handlers.js
//  The handlers are not part of SWFUpload but are part of my website and control how
//  my website reacts to the SWFUpload events.
file_queued_handler: fileQueued,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler: uploadComplete,

// Button settings
// button_image_url : "images/XPButtonNoText_160x22.png",
// button_placeholder_id : "spanButtonPlaceholder",
// button_width: 160,
// button_height: 22,
// button_text : '<span class="button">Select Files <span class="buttonSmall">(10 MB Max)</span></span>',
// button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 14pt; } .buttonSmall { font-size: 10pt; }',
// button_text_top_padding: 1,
// button_text_left_padding: 5,

// Flash Settings
flash_url : "swfupload/swfuplo