Uploadify:动态 FormData 不会改变 [英] Uploadify: Dynamic FormData does not change

查看:34
本文介绍了Uploadify:动态 FormData 不会改变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基于当前的uploadify文档,它使用formData(奇怪的是所有谷歌搜索结果,ppl都使用scriptData).问题是我尝试使用设置和 onUploadStart 事件手动更改 formData 作为这个 uploadify docs 说.但是,文件夹在到达服务器时始终保持不变(/webroot/newsletter).它应该是 (/webroot/newsletter/update),我正在以这种方式进行测试,因为该值稍后应该是动态的.知道这里出了什么问题吗?uploadify 论坛中还有一个问题 也是,但目前还没有答案

Based on the current uploadify documents, it uses formData (weird all google search results, ppl are using scriptData). The problem is I tried to manually change the formData using setting and onUploadStart event as this uploadify docs said. However the folder always stay the same (/webroot/newsletter) when it reaches the server. It should be (/webroot/newsletter/update), I am testing this way, as the value should be dynamic later on. Any clue what went wrong here? There is another question in the uploadify forum too but no answer so far

$('#file_upload').uploadify({
                            'method':'POST',
                            'formData' : { 'currentDirPath' : '/webroot/newsletter' } ,
                            'swf'      : '/js/uploadify-v3.1/uploadify.swf',
                            'uploader' : '/js/uploadify-v3.1/uploadify.php',
                            'checkExisting' : '/js/uploadify-v3.1/check-exists.php',
                            'onUploadStart' : function(file) {
                                 $("#file_upload").uploadify('settings', 'currentDirPath', "/webroot/newsletter/update");
                            } ,
                            'onUploadSuccess' : function(file, data, response) {
                                alert('The file was saved to: ' + data);
                            } 
                            // Put your options here
                        });

推荐答案

文档有误.应该是:

 $("#file_upload").uploadify('settings','formData' ,{'currentDirPath': /webroot/newsletter/update});

以防万一有人偶然发现这个问题.干杯.

Just in case if someone stumble on this problem. Cheers.

这篇关于Uploadify:动态 FormData 不会改变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆