Re: File Upload Size Limits

Joe Van Dyk
Tue, 22 Mar 2005 23:31:12 -0000

On Tue, 22 Mar 2005 16:56:49 -0600, Ben Sinclair
<bensinc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> Is there some sort of file upload size limit in Rails? I followed the
> Howto and am trying to upload into a mediumblob, but it only inserts
> 65k worth of data. I can manually insert more into my blobs, so I
> don''t think it''s a database issue. MySQL''s
max_packet_size defaults to
> 1MB, so that shouldn''t be a problem.
>
> If I insert more than 65k, I can stream the data just fine from my rails
app.
>
> I also added a LimitRequestBody directive in Apache, just in case the
> default was 65k, but I don''t think it is.
>
> I''m having this same issue on a Linux box and OSX, pointing at two
> different databases. My upload code looks like this:
>
> new_filename =
File.basename(@params[''file''].original_filename)
> filename = new_filename.sub(/[^\w\.\-]/,''_'')
>
> file = Psmfile.new
> file.name = new_filename
> file.data = @params[''file''].read
> file.save
>
> Does anyone know what the problem might be?

Is your form using GET or POST as its method?