如何使 swfupload setPostParams 在 Firefox 中工作?
我想在单击某些链接时在 swfupload 中设置一些参数,所以我做了这样的事情:(
swfu.setPostParams({"PHPSESSID": swfu.settings.post_params.PHPSESSID, "tutorial": tutorial, "step": nr});
这是一个教程编辑器,我想知道文件属于哪一步)
DOM 中的 postparams 被更改,但是我在 $_POST 中找不到它们。
某些 Flash 版本在 POST 中发送内容时存在问题,因此我在 swfupload 设置中添加了以下行:
use_query_string: true,
现在我在 $_GET 中获取参数,但也没有运气:我仍然获取原始参数。
在 IE 中它工作得很好。 有任何想法吗?
I want to set some params in my swfupload when some links are clicked, so i did something like this:
swfu.setPostParams({"PHPSESSID": swfu.settings.post_params.PHPSESSID, "tutorial": tutorial, "step": nr});
(this is a tutorial editor and i want to know to which step the file belongs to)
The postparams in the DOM is changed, but I can't find them in the $_POST.
Some flash versions have problems with sending stuff in POST, so I added the following line to my swfupload setup:
use_query_string: true,
Now i get the params in $_GET, but no luck there either: i still get the original params.
In IE it works just fine. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚遇到了一个非常相似的问题 - 我在 swf 对象的初始化中设置了 post_params ,它在那里获取页面上隐藏输入的值。但是如果我更改它们,这些值始终是默认值。
我将这段代码移至 uploadStart 处理程序(在“upload_start_handler”上触发) - 然后里面有类似这样的内容:
value1 是一个输入框,value2 是一个复选框 - 我正在使用 jQuery 获取值。
this.swf.setPostParams({
值1: $('#value1').val(),
value2: $('#value2').is(':checked')
});
效果很好 - 现在,当 Flash 上传器点击我的后端脚本时,就会填充这些值!
I've just had a very similar problem - I had post_params set in the initialization of the swf object and it was there to grab values of hidden inputs on my page.. but the values were always the defaults if I changed them.
I moved that bit of code to an uploadStart handler (fired on "upload_start_handler") - then something like this inside that:
value1 is an input box, value2 is a checkbox - and I'm getting the values with jQuery.
this.swf.setPostParams({
value1: $('#value1').val(),
value2: $('#value2').is(':checked')
});
Works a treat - the values are now populated when the flash uploader hits my back end script!