Reputation: 5999
I have an app with a lot of images uploaded via paperclip and stored on S3. I'm having some trouble where S3 is telling my iOS app that a few of the image keys don't exist (although I see that they indeed DO exist when I take a look at my S3 bucket). One of my theories is that this is being caused by the filenames, so I'd like to simplify my paperclip path.
My existing path is:
:path => "/:class/:style/:id_:basename.:extension"
I'd like it to be
:path => "/:class/:id/:style.:extension"
which is much cleaner.
My problem is that I'm not sure how to go about doing this. My first thought was to change the path format string in the model and then reprocess! all of the attachments, but now I realize that paperclip needs to use the original path to get at the original uploaded images before it can reprocess and save the images to a new path.
Is there a simple, quick way to make this change?
Thanks!
Upvotes: 2
Views: 1668
Reputation: 6726
You cannot 'rename' an object in S3. However, there is a copy command that will duplicate the object within S3. After you duplicate the object, delete the original.
Upvotes: 1