I have a rails project where I'm using Carrierwave to upload files to Amazon s3. 

I get a `bad URI(is not URI?)` error on my edit action when I upload a file with spaces in it such as `File Name.mp3`. How do I convert the spaces in a filename to underscores before uploading to s3?

Is there a configuration option I'm not finding in the docs, or do I need to create a method to do this?

**Updated:**

Here's my uploaders/track\_uploader.rb: <https://gist.github.com/leemcalilly/5025757>

Here's the model I'm attaching files to: <https://gist.github.com/leemcalilly/5025731>

Here's my controller: <https://gist.github.com/leemcalilly/5025765>

Note that when I use `"#{original_filename}".underscore` in the uploader the file uploads fine but it doesn't convert the filename, it just keeps the original filename with the space, like this: <https://www.evernote.com/shard/s3/sh/c5a08968-6f6d-4de8-a768-830a378572bc/10ee719307f3c587b531a37868127209>

And if I use `"#{filename}".underscore` I get a `stack level too deep` error.