SWFupload 如何传递参数?

swfupload感觉不是很舒服,不太习惯他的一些操作

测试代码后发现,事件代码必须有,否则无法正常上传图片

<script type="text/javascript">
         var swfu;
         window.onload = function () {
             swfu = new SWFUpload({
                 // Backend Settings
                 upload_url: "upload.aspx",
                 post_params: {
                     "upload": "images"
                 },

//启动,用来使用querystring 传递参数,否则无法进行参数传递
                    use_query_string:true,

                 // File Upload Settings
                 //file_size_limit: "2 MB",
                 //file_types: "*.jpg",
                 //file_types_description: "JPG Images",
                 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_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: "js/swfupload/images/XPButtonNoText_160x22.png",
                 button_placeholder_id: "spanButtonPlaceholder",
                 button_ 160,
                 button_height: 22,
                 button_text: '<span class="button">选择文件<span class="buttonSmall">(最大10M)</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: "js/swfupload/swfupload.swf", // Relative to this file

                 custom_settings: {
                     upload_target: "divFileProgressContainer"
                 },

                 // Debug Settings
                 debug: false
             });
         }
 </script>

原文地址:https://www.cnblogs.com/interdrp/p/2307112.html