我正在使用回形针在S3中上传图像。但我注意到,此上传非常慢。我认为是因为在完成提交之前,文件必须由我的服务器传递,进行处理并发送到S3服务器。
有加速的方法吗?
谢谢
我正在使用回形针为一栋建筑上传一张照片.http://www.youtube.com/watch?v=KGmsaXhIdjc我用这种方式完成了它.但我知道我决定将很多照片上传到一栋楼.我可以用回形针做到这一点,还是必须改变它并使用jQuery?如果我可以怎么样? Ps:如果需要,我会上传我的代码.ps:我想在photo2和photo 3的数据库中再制作2列.顺便说一句,我看到所有人都生成资产来做到这一点.我认为我用不同的方式上传1张照片.这意味着我必须改变一切吗?
更新1:
在routes.rb中
resources :buildings do
resources :photos
end
Run Code Online (Sandbox Code Playgroud)
在buldings> _form
<%= form_for(@building, :html=>{:multipart => true}) do |f| %>
<% if @building.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@building.errors.count, "error") %> prohibited this building from being saved:</h2>
<ul>
<% @building.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :title %><br />
<%= f.text_field :title %>
</div>
<div class="field">
<%= f.label :status %><br />
<%= f.select :status, Building::STATUS, …Run Code Online (Sandbox Code Playgroud)