Uploadify: Dynamic FormData does not change

无人久伴 提交于 2019-12-21 10:18:50

问题


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
                        });

回答1:


The documentation is wrong. It should be:

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

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



来源:https://stackoverflow.com/questions/10781368/uploadify-dynamic-formdata-does-not-change

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!