Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploadify: Dynamic FormData does not change

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
                        });
like image 922
Ardeus Avatar asked May 28 '12 08:05

Ardeus


1 Answers

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.

like image 78
Ardeus Avatar answered Oct 24 '22 13:10

Ardeus