SWFUpload 的 post 参数用法?

发布于 2024-10-05 16:29:06 字数 277 浏览 3 评论 0原文

您好,有人可以解释一下在 SWFUpload 中如何使用 post_param 吗?我需要在提交时加载 name='batchid' 的值。这就是示例文档显示的内容

post_params : {
    "post_param_name_1" : "post_param_value_1",
    "post_param_name_2" : "post_param_value_2",
    "post_param_name_n" : "post_param_value_n"
},

hi can someone explain how the post_param is used in SWFUpload. i need the value for name='batchid' loaded when i submit. this is what the example doc shows

post_params : {
    "post_param_name_1" : "post_param_value_1",
    "post_param_name_2" : "post_param_value_2",
    "post_param_name_n" : "post_param_value_n"
},

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

岁月如刀 2024-10-12 16:29:06

您是否尝试过:

post_params : {
    "name" : "batchid"
}

如果batchid是一个变量(我猜是这样),请使用您的php定义它并将其称为普通的js var:

post_params : {
    "name" : batchid
}

Have you tried:

post_params : {
    "name" : "batchid"
}

If batchid is a variable (I'm guessing so) define it using your php and call it as a normal js var:

post_params : {
    "name" : batchid
}
So要识趣 2024-10-12 16:29:06

初始化 SWFUPLOAD 后添加 POST 变量:

        var form = document.adminForm;
        if (form.catid.value == "0"){
    alert( "<?php echo JText::_( 'You must select a category', true ); ?>" );
       } else {
          var radio =  $('adminForm').value;    
          upload1.addPostParam("published" ,radio),
          upload1.addPostParam("cat_id" , document.adminForm.catid.value );
          upload1.addPostParam("MAX_FILE_SIZE" ,"5000000" );
          upload1.addPostParam("UPLOAD_MAX_FILESIZE" ,"5000000" );
      upload1.startUpload();
      }


            var upload1;
        window.onload = function() {
    upload1 = new SWFUpload({
    post_params: {},
        upload_url: "upload.php", 
            file_size_limit : "1024",
             ...

             })   

Add POST variables after initialisation SWFUPLOAD:

        var form = document.adminForm;
        if (form.catid.value == "0"){
    alert( "<?php echo JText::_( 'You must select a category', true ); ?>" );
       } else {
          var radio =  $('adminForm').value;    
          upload1.addPostParam("published" ,radio),
          upload1.addPostParam("cat_id" , document.adminForm.catid.value );
          upload1.addPostParam("MAX_FILE_SIZE" ,"5000000" );
          upload1.addPostParam("UPLOAD_MAX_FILESIZE" ,"5000000" );
      upload1.startUpload();
      }


            var upload1;
        window.onload = function() {
    upload1 = new SWFUpload({
    post_params: {},
        upload_url: "upload.php", 
            file_size_limit : "1024",
             ...

             })   
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文