I''m using the attachment_fu plugin in the following manner to upload a
file.
http://khamsouk.souvanlasy.com/2007/5/1/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent
I ge tthe following error if I upload a file that''s over 1K or so. It
works fine for small files (500 bytes or so):
1 error prohibited this raw data file from being saved
There were problems with the following fields:
* Size is not included in the list
This is using the POST action in the scaffold_resource generated
controller
Chirag
# POST /raw_data_files
# POST /raw_data_files.xml
def create
@raw_data_file = RawDataFile.new(params[:raw_data_file])
respond_to do |format|
if @raw_data_file.save
flash[:notice] = ''RawDataFile was successfully
created.''
format.html { redirect_to raw_data_file_url(@raw_data_file) }
format.xml { head :created, :location =>
raw_data_file_url(@raw_data_file) }
else
format.html { render :action => "new" }
format.xml { render :xml => @raw_data_file.errors.to_xml }
end
end
end
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
On 6/26/07, chirag <patelc75-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> > I''m using the attachment_fu plugin in the following manner to upload a > file. > http://khamsouk.souvanlasy.com/2007/5/1/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent > > > I ge tthe following error if I upload a file that''s over 1K or so. It > works fine for small files (500 bytes or so): > > 1 error prohibited this raw data file from being saved > There were problems with the following fields: > * Size is not included in the listThat''s a validation error. Either you set your min/max values incorrectly, or you don''t have rmagick/imagescience/minimagick so that attachment_fu can set the correct size. -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.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 -~----------~----~----~----~------~----~------~--~---
I changed the following line in the model from :max_size => 2.megabytes to :size => 0.megabyte..2.megabytes and it worked. Thanks rick! On Jun 27, 1:25 am, "Rick Olson" <technowee...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 6/26/07, chirag <patel...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > > > > > I''m using the attachment_fu plugin in the following manner to upload a > > file. > >http://khamsouk.souvanlasy.com/2007/5/1/ajax-file-uploads-in-rails-us... > > > I ge tthe following error if I upload a file that''s over 1K or so. It > > works fine for small files (500 bytes or so): > > > 1 error prohibited this raw data file from being saved > > There were problems with the following fields: > > * Size is not included in the list > > That''s a validation error. Either you set your min/max values > incorrectly, or you don''t have rmagick/imagescience/minimagick so that > attachment_fu can set the correct size. > > -- > Rick Olsonhttp://lighthouseapp.comhttp://weblog.techno-weenie.nethttp://mephistoblog.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 -~----------~----~----~----~------~----~------~--~---