<i id='ZW7lE'><tr id='ZW7lE'><dt id='ZW7lE'><q id='ZW7lE'><span id='ZW7lE'><b id='ZW7lE'><form id='ZW7lE'><ins id='ZW7lE'></ins><ul id='ZW7lE'></ul><sub id='ZW7lE'></sub></form><legend id='ZW7lE'></legend><bdo id='ZW7lE'><pre id='ZW7lE'><center id='ZW7lE'></center></pre></bdo></b><th id='ZW7lE'></th></span></q></dt></tr></i><div id='ZW7lE'><tfoot id='ZW7lE'></tfoot><dl id='ZW7lE'><fieldset id='ZW7lE'></fieldset></dl></div>

      • <bdo id='ZW7lE'></bdo><ul id='ZW7lE'></ul>
      <tfoot id='ZW7lE'></tfoot>
    1. <legend id='ZW7lE'><style id='ZW7lE'><dir id='ZW7lE'><q id='ZW7lE'></q></dir></style></legend>

    2. <small id='ZW7lE'></small><noframes id='ZW7lE'>

      如何使用 PLupload 发送附加数据?

      How to send additional data using PLupload?(如何使用 PLupload 发送附加数据?)
    3. <legend id='4s4id'><style id='4s4id'><dir id='4s4id'><q id='4s4id'></q></dir></style></legend>

        <bdo id='4s4id'></bdo><ul id='4s4id'></ul>
            <tbody id='4s4id'></tbody>

          <i id='4s4id'><tr id='4s4id'><dt id='4s4id'><q id='4s4id'><span id='4s4id'><b id='4s4id'><form id='4s4id'><ins id='4s4id'></ins><ul id='4s4id'></ul><sub id='4s4id'></sub></form><legend id='4s4id'></legend><bdo id='4s4id'><pre id='4s4id'><center id='4s4id'></center></pre></bdo></b><th id='4s4id'></th></span></q></dt></tr></i><div id='4s4id'><tfoot id='4s4id'></tfoot><dl id='4s4id'><fieldset id='4s4id'></fieldset></dl></div>
            1. <small id='4s4id'></small><noframes id='4s4id'>

              1. <tfoot id='4s4id'></tfoot>

                本文介绍了如何使用 PLupload 发送附加数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在使用 plupload 进行 ajax 文件上传.现在 plupload.Uploader 类有很多选项,但没有一个是附加数据.

                I'm using plupload to make an ajax file uploading. Now the plupload.Uploader class has many options but none are additional data.

                例如:

                var uploader = new plupload.Uploader({
                    runtimes : 'gears,html5,flash,silverlight,browserplus',
                    browse_button : 'pickfiles',
                    container : 'contact_container',
                    max_file_size : '10mb',
                    url : 'upload.php',
                    flash_swf_url : '/plupload/js/plupload.flash.swf',
                    silverlight_xap_url : '/plupload/js/plupload.silverlight.xap',
                    filters : [
                        {title : "Image files", extensions : "jpg,gif,png"},
                        {title : "Zip files", extensions : "zip"}
                    ],
                    resize : {width : 320, height : 240, quality : 90}
                });
                

                我想要实现的是我的服务器中有一个文件夹,所有上传的内容都在其中正在被拯救.我需要在文件夹内为每个已上传文件的用户创建一个子文件夹.如何将用户 ID 等数据添加到 plupload.Uploader 的实例中?或者,如果我在容器 div 中包装一个表单,我能在 $_REQUEST 中看到它吗?或者有其他方法可以实现吗?

                What i'm trying to achive is i have a folder in my server where all the uploads are being saved. I neeed inside the folder to create a sub-folder to each user that have uploaded files there. How can i add data like id of the user to the instance of plupload.Uploader? Or if i'll wrap a form inside the container div, will i be able to see it in the $_REQUEST? Or is there some other way i can achive this?

                推荐答案

                您是否尝试过使用 multipart_params 的设置?像这样向您的 plupload.Uploader 添加一个附加选项:

                Have you tried using the setting for multipart_params? Add an additional option to your plupload.Uploader like so:

                var uploader = new plupload.Uploader({
                    runtimes : 'gears,html5,flash,silverlight,browserplus',
                    browse_button : 'pickfiles',
                    container : 'contact_container',
                    max_file_size : '10mb',
                    url : 'upload.php',
                    flash_swf_url : '/plupload/js/plupload.flash.swf',
                    silverlight_xap_url : '/plupload/js/plupload.silverlight.xap',
                    filters : [
                        {title : "Image files", extensions : "jpg,gif,png"},
                        {title : "Zip files", extensions : "zip"}
                    ],
                    resize : {width : 320, height : 240, quality : 90},
                    multipart_params : {
                        "name1" : "value1",
                        "name2" : "value2"
                    }
                });
                

                然后您需要处理处理上传的文件中的值(默认为upload.php).我认为这些值是由 $_POST 捕获的,但您可以使用 $_REQUEST 来确定.

                You will then need to process the values in the file that handles the upload (upload.php by default). I think the values are captured by $_POST but you can use $_REQUEST just to be sure.

                我使用 jQuery 动态分配值,因此您可以使用 "name1" : $("#name1" 之类的东西来代替 "name1" : "value1").val(), 其中#name1 可能是页面其他地方的输入.

                I've used jQuery to assign values on the fly, so instead of "name1" : "value1" you can use something like "name1" : $("#name1").val(), where #name1 might be an input elsewhere on the page.

                对于其中一些设置,Plupload 的文档有点稀疏.

                Plupload's documentation is a little sparse for some of these settings.

                这篇关于如何使用 PLupload 发送附加数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                  <small id='IGIv6'></small><noframes id='IGIv6'>

                • <i id='IGIv6'><tr id='IGIv6'><dt id='IGIv6'><q id='IGIv6'><span id='IGIv6'><b id='IGIv6'><form id='IGIv6'><ins id='IGIv6'></ins><ul id='IGIv6'></ul><sub id='IGIv6'></sub></form><legend id='IGIv6'></legend><bdo id='IGIv6'><pre id='IGIv6'><center id='IGIv6'></center></pre></bdo></b><th id='IGIv6'></th></span></q></dt></tr></i><div id='IGIv6'><tfoot id='IGIv6'></tfoot><dl id='IGIv6'><fieldset id='IGIv6'></fieldset></dl></div>
                        <bdo id='IGIv6'></bdo><ul id='IGIv6'></ul>
                        <legend id='IGIv6'><style id='IGIv6'><dir id='IGIv6'><q id='IGIv6'></q></dir></style></legend>
                        <tfoot id='IGIv6'></tfoot>

                          <tbody id='IGIv6'></tbody>