我使用gem "paperclip"
上传图片,gem "paperclip-storage-ftp"
用于我自己的ftp服务器上的商店图片。它工作正常一段时间,但现在我上传照片时出现随机错误。
有时这个
Net::FTPReplyError - 150 Connecting to port 3270
有时这个
Net::ReadTimeout - Net::ReadTimeout:
有时这个
Paperclip::Storage::Ftp::NoServerAvailable
..有时这个:
Net::FTPPermError - 500 ?
模型
class AlbumPhoto < ActiveRecord::Base
has_attached_file :photo, {
# Choose the FTP storage backend
:storage => :ftp,
:path => "www.abcd.com/:attachment/:id/:style/:filename",
:url => "ftp://abcd@domain.com@domain.com/www.abcd.com/:attachment/:id/:style/:filename",
:ftp_servers => [
{
:host => "domain.com",
:user => "abcd@domain.com",
:password => "abcd123",
:passive => true
}
],
:styles => { :medium => "300x300^", :thumb => "100x100^" ,:large => "400x400^"},
}
end
为什么会这样?