8

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

$('#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
                        });
4

1 回答 1

30

文档是错误的。它应该是:

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

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

于 2012-05-29T11:08:03.577 回答