I used gem "paperclip"
for upload images and gem "paperclip-storage-ftp"
for store images on my own ftp server. It worked fine for a while, but now I am getting random errors, when I upload photos.
Sometimes this
Net::FTPReplyError - 150 Connecting to port 3270
Sometime this
Net::ReadTimeout - Net::ReadTimeout:
Sometime this
Paperclip::Storage::Ftp::NoServerAvailable
.. and sometimes this:
Net::FTPPermError - 500 ?
Model
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://[email protected]@domain.com/www.abcd.com/:attachment/:id/:style/:filename",
:ftp_servers => [
{
:host => "domain.com",
:user => "[email protected]",
:password => "abcd123",
:passive => true
}
],
:styles => { :medium => "300x300^", :thumb => "100x100^" ,:large => "400x400^"},
}
end
Why is this happening?
:ftp_connect_timeout => 5, # optional, nil by default (OS default timeout)
&:ftp_ignore_failing_connections => true, # optional, false by default
– Steffaniesteffen