Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

ruby on rails - getting random error while upload photo with paperclip on my ftp server

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://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

Why is this happening?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...