Hi, I''m trying to set up file_column to upload attachments for emails. My view has <td align="left"><%= file_column_field ''to_do'', ''attachment'' %></td> and the attachment_temp hidden field is generated. When I inspect tthe params on saving the form the attachment_temp param is always an empty string. Also, when I was setting this up I got a no method error attachment_temp on save and had to (temporarily I hope) add that field to the table. The to_do model has ''file_column :attachment'' On save, the attachment field is updated with the correct file name but no upload takes place. I''m just not seeing why the _temp field is not gwtting a value. Any clues? TIA, Eric.
your form properbly misses multipart encoding ala <form action="/something" METHOD=''POST'' ENCTYPE=''multipart/form-data''> On 5/2/06, Eric Sloane <esloane@exemail.com.au> wrote:> > Hi, > I''m trying to set up file_column to upload attachments for emails. My > view has <td align="left"><%= file_column_field ''to_do'', ''attachment'' > %></td> and the attachment_temp hidden field is generated. When I > inspect tthe params on saving the form the attachment_temp param is > always an empty string. Also, when I was setting this up I got a no > method error attachment_temp on save and had to (temporarily I hope) add > that field to the table. The to_do model has ''file_column :attachment'' > On save, the attachment field is updated with the correct file name but > no upload takes place. I''m just not seeing why the _temp field is not > gwtting a value. Any clues? > TIA, > Eric. > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060502/e7a686fd/attachment.html
Hi Brian, Thanks for the response. I have <%= start_form_tag :controller => ''to_dos'', :action => ''add_to_dos'', :id => @job, :multipart => true %> in my view which is generating <form action="/to_dos/add_to_dos/1?multipart=true" method="post"> - but I still get an error re: Check if the form''s encoding has been set to ''multipart/form-data''. Can you see anything wrong here? Cheers, Eric. Brian ?gren wrote:> your form properbly misses multipart encoding ala > > <form action="/something" METHOD=''POST'' ENCTYPE=''multipart/form-data''> > > On 5/2/06, *Eric Sloane * > <esloane@exemail.com.au > <mailto:esloane@exemail.com.au>> wrote: > > Hi, > I''m trying to set up file_column to upload attachments for emails. My > view has <td align="left"><%= file_column_field ''to_do'', ''attachment'' > %></td> and the attachment_temp hidden field is generated. When I > inspect tthe params on saving the form the attachment_temp param is > always an empty string. Also, when I was setting this up I got a no > method error attachment_temp on save and had to (temporarily I hope) add > that field to the table. The to_do model has ''file_column :attachment'' > On save, the attachment field is updated with the correct file name but > no upload takes place. I''m just not seeing why the _temp field is not > gwtting a value. Any clues? > TIA, > Eric. > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > <mailto:Rails@lists.rubyonrails.org> > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Hi, Have solved my own dumb problem - I shoulda been putting braces around my url_for_options and options when I added the multipart statement. Sorry to be a nuisance Cheers, Eric. Brian ?gren wrote:> your form properbly misses multipart encoding ala > > <form action="/something" METHOD=''POST'' ENCTYPE=''multipart/form-data''> > > On 5/2/06, *Eric Sloane * > <esloane@exemail.com.au > <mailto:esloane@exemail.com.au>> wrote: > > Hi, > I''m trying to set up file_column to upload attachments for emails. My > view has <td align="left"><%= file_column_field ''to_do'', ''attachment'' > %></td> and the attachment_temp hidden field is generated. When I > inspect tthe params on saving the form the attachment_temp param is > always an empty string. Also, when I was setting this up I got a no > method error attachment_temp on save and had to (temporarily I hope) add > that field to the table. The to_do model has ''file_column :attachment'' > On save, the attachment field is updated with the correct file name but > no upload takes place. I''m just not seeing why the _temp field is not > gwtting a value. Any clues? > TIA, > Eric. > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > <mailto:Rails@lists.rubyonrails.org> > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails