Sujith Gangaraju wrote:> I am uploading on html file and saving in public folder for this i am
> writing this code
> def self.save(upload)
> name = upload[''datafile''].original_filename
> directory = "public/uploads"
> path = File.join(directory, name)
> str ="Hi9 How r u "
> File.open(path, "a") { |f| f.puts str }
> return name
> end
> what this is doing means i am inserting str into that file
> it is over writing the existing file content
> i dont want to overwrite , i want to add in the last line of the
> document
> please help me on this
Try once more sujith............
Come onnnnnn....
you can do ittttttt................
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---