I've used Settings -> Media to define an alternate domain to serve static files (CSS, JS, IMG, for example) and it's working great as a dedicated CDN, but I've run into an issue and have a question about resolving it in the best way.
What I'd like to do is intercept mp3 files (only) and upload them to an alternate domain; ie, a 2nd CDN. This may seem excessive, but I don't want any large audio files hogging up the stream as the rest of my site is slurped into the browser.
I'm not very familiar with how WordPress works in terms of debugging. For example, sometimes a print_r will work, sometimes it won't, so I'm guessing that it depends where it's called. What I need to do is dump some variables from within the upload function to the screen so I can see what I have to work with. I'm looking at the wp_upload_bits function and it looks like the right place to find the data I need, but I just can't seem to get it printed out.
I did try a whole slew of debug plugins, none of which worked -- presumably because they've not been updated for WP 3.4. But I also notice that Google is full of fresh posts about 3.4's debugging not working properly, so I wasn't sure if that might be related. A search here on the forums didn't turn up anything relevant, so after a year on WordPress, I finally had to break down and create an account here to ask for some help. (That speaks volumes to the docs and the myriad of support sites out there!)
Any insights would be greatly appreciated!