Conditional add_filter for upload directory?

I know it’s been a while, but I wanted to offer a solution, if only for those who come across this question via Google.

The issue is with the order of the parameters in the query string when you build the URL for the media uploader. My experience is that any parameters that come after ‘TB_iframe=1’ are ignored, so you want to put your custom values before this. I haven’t seen this documented (and haven’t explored core to see why the parameters are handled this way), but can’t think of any good reason for it–I probably spent an hour tearing my hair out before I discovered the issue.

I also haven’t tried this in 3.5 yet. With all the changes to the media uploader it’s possible that this has been addressed.