<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 发送附加数据?

      时间:2023-12-02
    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 发送附加数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:在 php 中的 mp4 =&gt;mp3 转换后更改 js/ajax 中的按钮文本 下一篇:php在上传时调整图像大小会在我不想要它时旋转图像

                相关文章

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

              2. <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>