Closed yesmeck closed 4 years ago
我有同樣問題 Ruby-China 的解答,對我無效,請問有解決方法麼?
我也遇到了同样的问题,后来把filename给重写了,反正这个方法也只是为了返回一个文件名字符串好去图片空间访问,那么我们也能自己写一个名字的生成器来生成一个不会重复的文件名就可以了,联想到密码密文的生成方法,有人给出了这样的解决方案:
def filename
if super.present?
@name ||="#{Digest::MD5.hexdigest(original_filename)}.#{file.extension.downcase}" if original_filename
end
end
uploader 就是按 readme 里写的。保存图片的时候会有这个错误,是否跟我是用 carrierwave 远程抓取图片的有关?