Net::FTPPermError (500 我不会打开到 10.10...... 的连接 (仅到 174.12......)
我有一个 Rails 应用程序部署到 Heroku。我使用 paperclipftp 将文件上传到 ftp 服务器,因为 heroku 没有提供太多文件上传功能。因此,当我尝试上传文件并保存记录时,出现此错误。
Net::FTPPermError (500 I won't open a connection to 10.10...... (only to 174.12........)
我不知道为什么会这样经过一番搜索,我发现 Heroku 不允许主动 FTP 连接,因此尝试通过编辑 paperclipftp 文件来建立被动连接,
我在其初始化块中添加了这一行
@ftp.passive = @ftp_credentials[ 变量
[passive:true]
但它仍然不起作用。
:passive] if @ftp_credentials.has_key?("passive") 并在我的 YAML 配置文件中传递了一个 。 提前致谢。
I have a rails app deployed to heroku. I have used paperclipftp to upload files to an ftp server, as heroku doesn't give much features with file uploading. So when I try to upload a file and save a record, I get this error.
Net::FTPPermError (500 I won't open a connection to 10.10...... (only to 174.12........)
I don't know why this is coming up. After some searching I came to know that Heroku doesn't allow active FTP connections so tried to establish a passive connection by editing the paperclipftp file.
I added this line in its initialize block
@ftp.passive = @ftp_credentials[:passive] if @ftp_credentials.has_key?("passive")
and passed a variable [passive:true]
in my YAML config file. But still it doesn't work.
Please Help. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您找到问题的答案了吗?我面临着完全相同的问题,并且不知道如何绕过这个问题。解决方案可能是使用 Amazon S3 来保存文件。我会朝这个方向检查并通知您。
问候,
Luc
编辑(28/03/11):S3 绝对是一个很棒的解决方案,非常容易设置。最重要的是,如果您没有大量图片要上传,那么它真的很便宜
have you found an answer to your problem ? I'm facing the exact same issue and do not know how to bypass this. A solution could be to use Amazon S3 to save your file. I will check in this direction and let you know.
Regards,
Luc
EDIT (28/03/11): S3 is definitively a great solution, very easy to setup. On top of this it's really cheap if you do not have tons of pictures to upload