How does carrierwave change files name?

Viewed 44

I uploaded some files and thier names were changed like this

MY_FILE (1).jpg  =>  MY_FILE__1_.jpg
MY_FILE (1) (1).jpg  =>  MY_FILE__1___1_.jpg
MY_FILE_(1).jpg  =>  MY_FILE__1_.jpg
MY_FILE_(1) (copy).jpg  =>  MY_FILE__1___copy_.jpg
MY_FILE-(1).jpg  =>  MY_FILE-_1_.jpg

it's creating problem for me, because I'm saving file using ajax and checking filename in response. but filename from response does not match with my uploaded file. Because carrierwave changed it.

I wants to know which regular expression they are using to change filename. I check in the gem but I'm not sure where to look.

0 Answers
Related