On Nov 3, 9:30 am, Raju Aralikatti <rails-mailing-l...@andreas-s.net>
wrote:
> Thanks for your reply fred,
>
> file = File.new(File.join(file_path), "wb")
> file.write(params['file_' + i.to_s].read)
>
> You mean to say my code must be like this,
>
> file = File.new(File.join(file_path), "wb")
> file.write(params['file_' + i.to_s].read)
> file.close
>

yup, something like that.

File.open(path, 'wb') do |file|
  file.write(...)
end

is nicer because it ensures the file gets closed (obviously you could
replicate this yourself but File.open already does it so not much
point)

> But I am not getting the attachments properly in my email. If you can
> send your email ID I will send an email to you through my app, so that
> you can tell me what is the problem

Sounds like you need to isolate the problem: is the mailer fine but it
is being given half uploaded files, or is the uploading part happening
file but the mailer is ok?

Fred
>
> Thanks,
> Raju
> --
> Posted viahttp://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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to