Forum: Ruby imginfo = Magick::Image.read(@params['name']) .first

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9aa1e92a0ebb17fdaad2fa39b4c52b8a?d=identicon&s=25 misiek (Guest)
on 2006-03-06 22:41
(Received via mailing list)
I  try do upload of image but before I need to check the size of it
so I made the form to uplaod

<%= form_tag({:action=>'upload', :id => @property.id }, :multipart =>
true )%>
   <%= file_field 'image', 'name' %><br>
   <%= submit_tag "send" %>
<%= end_form_tag %>


and in controller I have
imginfo = Magick::Image.read(@params['image']['name']) .first

but the params @params['image']['name'] is wrong ????

unable to open image `#<File:0xb75bfa00>': No such file or directory:


I save this file like that so I use paraqs the same ??
#File.open("#{RAILS_ROOT}/public/images/#{params[:id]}/oryg/#{new_image.name}",
"w") { |f| f.write(@params['image']['name'].read) }
This topic is locked and can not be replied to.