Forum: Ruby save file

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-01 03:03
(Received via mailing list)
my form

<%= form_tag :action => 'upload', :id => @property.id %>
   <%= file_field 'images', 'name' %>
   <%= submit_tag "send" %>
<%= end_form_tag %>

@user = "new_image"
File.open("#{RAILS_ROOT}/public/images/#{@user}.jpg", "wb") do |f|
      f.write(@params['name'])
end

and ? and nothing o got new_image.jpg file but is empty


I wa trying like
f.write(File.open(@params['image_file']).read)
than A got error

Can't convert Array into String

so what I am doing wrong ?
4299e35bacef054df40583da2d51edea?d=identicon&s=25 James Gray (bbazzarrakk)
on 2006-03-01 05:27
(Received via mailing list)
On Feb 28, 2006, at 7:57 PM, misiek wrote:

> my form
>
> <%= form_tag :action => 'upload', :id => @property.id %>

Should that be:

<%= form_tag({:action => "upload", :id => @property}, :multipart =>
true) %>

?

James Edward Gray II
9aa1e92a0ebb17fdaad2fa39b4c52b8a?d=identicon&s=25 misiek (Guest)
on 2006-03-01 17:58
(Received via mailing list)
James Edward Gray II wrote:
> true) %>
>
> ?
>
> James Edward Gray II
>
>

yes that's correct , thanks
84849a10335a327937ae3efd872a085e?d=identicon&s=25 Eric Luo (Guest)
on 2006-03-11 04:20
(Received via mailing list)
>>>>> "James" == James Edward Gray <james@grayproductions.net> writes:
I have the same problem.
It works,
Thanks
  James> On Feb 28, 2006, at 7:57 PM, misiek wrote:
  >>  my form
  >>
  >>  <%= form_tag :action => 'upload', :id => @property.id %>

  James> Should that be:

  James> <%= form_tag({:action => "upload", :id => @property},
:multipart =>
  James> true) %>

  James> ?

  James> James Edward Gray II
This topic is locked and can not be replied to.