0

我在网页上设置了一个 plupload 脚本,当您上传文件时,它们被保存到正确的目录,但是当您提交包含上传程序的表单时,它将 POST 变量传递给一个简单的转储脚本。

该脚本的输出是:

uploader_0_tmpname  p180vem99v11u6e517hcqolbj14.jpg
uploader_0_name Test1.jpg
uploader_0_status   done
uploader_1_tmpname  p180vfjm2p12uoumicd71qica544.jpg
uploader_1_name Test2.jpg
uploader_1_status   done

是否可以将数据作为数组传递UploadedImages,然后数据可以如下所示?

array(
    "0" => "p180vem99v11u6e517hcqolbj14.jpg",
    "1" => "p180vfjm2p12uoumicd71qica544.jpg",
)

如果没有,是否可以创建一个 php 脚本将这些变量转换为可用的数组?

4

1 回答 1

0

在 jquery.plupload.queue.js 文件中,搜索并编辑以下行:

l+='<input type="hidden" name="'+k+"_"+n+'_tmpname" value="'+plupload.xmlEncode(o.target_name)+'" />'

l+='<input type="hidden" name="'+k+"["+n+'][tmpname]" value="'+plupload.xmlEncode(o.target_name)+'" />'

现在:

l+='<input type="hidden" name="'+k+"_"+n+'_name" value="'+plupload.xmlEncode(o.name)+'" />'

l+='<input type="hidden" name="'+k+"["+n+'][name]" value="'+plupload.xmlEncode(o.name)+'" />'

最后:

l+='<input type="hidden" name="'+k+"_"+n+'_status" value="'+(o.status==plupload.DONE?"done":"failed")+'" />'

l+='<input type="hidden" name="'+k+"["+n+'][status]" value="'+(o.status==plupload.DONE?"done":"failed")+'" />'

于 2013-08-02T13:07:45.647 回答