首页 新闻 会员 周边 捐助

在线等答案 急急急 swfupload 参数的修改

0
悬赏园豆:100 [待解决问题]

<script type="text/javascript">
          var swfu;

         window.onload = function () {

              swfu = new SWFUpload({
                  // Backend Settings
                  upload_url: "Upload.ashx",
                  post_params: {

                      "name": "<%=this.txtName.Text %>",
                      "type": "<%=this.txtType.Text %>",
                     
                      "image": "<%=this.txtFile.Text %>"
                  },
                  use_query_string: true,
                  // File Upload Settings
                  // File Upload Settings
                  file_size_limit: "4 MB",
                  file_types: "*.*",
                  file_types_description: " ",
                  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.
                  swfupload_preload_handler: preLoad,
                  swfupload_load_failed_handler: loadFailed,
                  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_width: 90,
                  button_height: 22,
                 
                  button_text: '选择上传文件',
                  button_text_style: '.button { background-color :#DAE8F0 } ',
                  button_text_top_padding: 1,
                  button_text_left_padding: 5,

                  // Flash Settings
                  flash_url: "/js/swfupload/swfupload.swf", // Relative to this

file
                  flash9_url: "/js/swfupload/swfupload_FP9.swf", // Relative to

this file

                  custom_settings: {
                      upload_target: "divFileProgressContainer",
                       cancelButtonId: "btnCancel1"
                  },

                  // Debug Settings
                  debug: false

              });

              $("#btnUpload1").click(function () {
                  if (document.getElementById("ddlType").value == "请首先选择上传

附件类型") {
                      alert("请首先选择上传附件类型");
                      return;
                  };
                  //swfu.addPostParam("typef", "<%=this.ddlType.SelectedValue %

>");
                 // this.setPostParam("typef", "<%=this.ddlType.SelectedValue %

>");
                  this.setPostParams({ "name": "<%=this.txtName.Text %>",
                      "type": "<%=this.txtType.Text %>",
                     
                      "image": "<%=this.txtFile.Text %>", "typef": "<%

=this.ddlType.SelectedValue %>" });
                  swfu.startUpload();

              });
          }
       
    </script>

如何在页面加载完之后 再次修改PostParams  取得this.ddlType.SelectedValue 这个值然后

传给请求的页面Upload.ashx

蜜乐佛的主页 蜜乐佛 | 初学一级 | 园豆:104
提问于:2012-08-29 10:47
< >
分享
所有回答(3)
0

帮顶!!!!

jason2013 | 园豆:1998 (小虾三级) | 2012-08-29 11:01
0
var swfu;

if
(swfu) {swfu.destroy(); }
swfu = new SWFUpload(getSettings);

getSettings就是你上面的配置 重新初始化一次
 
贺臣 | 园豆:307 (菜鸟二级) | 2012-08-29 16:08

谢谢 ,已经能修改了  通过   swfu.setPostParams({
                    "name": $('txtName').val(),
                    "type": $('txtType').val(),
                    "typef": $('#ddlType').val(),
                    "image": $('txtFile').val()
                });

                swfu.startUpload();
                swfu.uploadStart(swfu.initSettings);

支持(0) 反对(0) 蜜乐佛 | 园豆:104 (初学一级) | 2012-08-29 16:13

@蜜乐佛:  swfu.setPostParams({ 
                    "name": $('txtName').val(),
                    "type": $('txtType').val(),
                    "typef": $('#ddlType').val(),
                    "image": $('txtFile').val()
                });

                swfu.startUpload();
                swfu.uploadStart(swfu.initSettings);

你这些代码是写在哪里的啊

支持(0) 反对(0) 小羔羊吃大灰狼 | 园豆:200 (初学一级) | 2013-11-28 13:42
0

swfu.uploadStart(swfu.initSettings);

蜜乐佛 | 园豆:104 (初学一级) | 2012-08-29 16:13
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册