简体   繁体   中英

Carrierwave rename uploaded images

I am using CarrierWave for uploading images. I also have some image cropping that happens later. This process includes sending of the cropped-area dimensions from the client(javascript) and then recreate a cropped image on the server. After this I would like to rename all the version filenames.

Is it possible after the cropping process, I can rename all the various versions. I do not wish to recreate the versions but rather just rename the already existing versions.

You can rewrite method in your uploader

def filename
  "new_name_for_file" if file     
end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM