read the manual (api.rubyonrails.org) and perhaps try this:
in your view:
<div class="title_heading">Fileupload
<%= start_form_tag({:action => ''upload_file''},
:multipart =>
true) %>
<%= file_field_tag("uploaded_file")%>
<%= submit_tag(''Save'')%>
<%= end_form_tag %>
</div>
in the controller:
def upload_file
file_content = ""
file_io = params[:uploaded_file]
file_io.each_line {|line|
}
render :text => "duh..."
end
On 27 Jun., 16:35, swamy
<gsswamy....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi friends,
>
> i am a fresher to ruby on rails . i need sample code/program
> of how to download or upload files,and i also want code to stage a
> file instead of posting it to a webserver.
>
> i would be thankful if u can give me this information
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---