在Ruby on Rails中上传文件 [英] Uploading files in Ruby on Rails

查看:219
本文介绍了在Ruby on Rails中上传文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web应用程序需要从用户上传文件并将其上传到远程服务器。我可以通过file_field从用户输入到服务器,但似乎无法解决从服务器上传到远程的下一步。 Net :: HTTP并不是开箱即用的多部分表单,我还找不到另一个好的解决方案。我需要的东西,将允许我从用户 - >服务器 - >远程,而不是去用户 - >远程。任何人都可以成功做到这一点?

解决方案

我相信attachment_fu插件可以做到这一点:$ b​​
$ b

http://svn.techno-weenie.net/ projects / plugins / attachment_fu /

I have a web application that needs to take a file upload from the user and upload it to a remote server. I can take input from user to server fine via file_field, but can't seem to work out the next step of uploading from server to remote. Net::HTTP doesn't do multipart forms out of the box, and I haven't been able to find another good solution. I need something that will allow me to go from user -> server -> remote instead of going user -> remote. Anyone succeeded in doing this before?

解决方案

I believe the attachment_fu plugin would allow for this:

http://svn.techno-weenie.net/projects/plugins/attachment_fu/

这篇关于在Ruby on Rails中上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆