ruby on rails - How to copy file in amazon s3 Paperclip? -
i have model shop
has logo
and it's stored in amazon s3, want copy model company
, i'm doing simply:
shop = shop.find(1) company = company.find(1) company.logo = shop.logo company.save!
but giving error:
[paperclip] copying logos/1/original/220px-bart_simpson.png local file /tmp/dac9e3329951078b23c5deed39f3193120160107-30855-ivrdms.png no such key - cannot copy logos/1/original/220px-bart_simpson.png local file /tmp/dac9e3329951078b23c5deed39f3193120160107-30855-ivrdms.png command :: file -b --mime '/tmp/dac9e3329951078b23c5deed39f3193120160107-30855-nz0h5c.png' [paperclip] content type spoof: filename 220px-bart_simpson.png (["image/png"]), content type discovered file command: inode/x-empty. see documentation allow combination. rollback activerecord::recordinvalid: validation failed: logo has extension not match contents
can hell going on here, or how it?
can try as, may know version of paperclip being used.
shop = shop.find(1) company = company.find(1) company.logo = file.open(shop.logo.path, 'rb') company.save!
Comments
Post a Comment