|
I have been using Carrierwave for file uploads for some time. I did not try to rename the files as they got uploaded. Now I want to give each file a random name and a file extension that's consistent with the content type. I read the wiki and other sites, and it was recommended that in the uploader, I could:
It worked fine on files uploaded after these additions to the uploader. But I got many files that were uploaded before this change. I was wondering if someone could tell me how to migrate the old files. I tried adding a method to the uploader:
then in the rails console, I tried calling this on an model with attachment. However, I found that the How can I get the In addition, it seemed like the old files with the old names were still on the file system. Is there a way to remove them? I tried adding a line:
in the |