views:

634

answers:

1

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?

A: 

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!

rgubby