# Large uploads with attchment-fu

**URL:** <https://www.ruby-forum.com/t/large-uploads-with-attchment-fu/157446>\
**Category:** Rails\
**Created:** [January 11, 2009, 12:52pm UTC](https://www.ruby-forum.com/t/large-uploads-with-attchment-fu/157446 "2009-01-11T12:52:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![r-a-mueller](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/dfb087/32.png) [@r-a-mueller](https://www.ruby-forum.com/u/r-a-mueller)\
**Post date:** [January 11, 2009, 12:52pm UTC](https://www.ruby-forum.com/t/large-uploads-with-attchment-fu/157446/1 "2009-01-11T12:52:37Z")

</div>

Hi  
I am trying to upload 30mb files with attachment-fu, these seem to  
just hang. (works file for small image files)  
I am using mongrel cluster and nginx…

Does anyone have any advice?

Thanks

Richard

---

<div class="post-metadata">

**Author:** ![r-a-mueller](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/dfb087/32.png) [@r-a-mueller](https://www.ruby-forum.com/u/r-a-mueller)\
**Post date:** [January 11, 2009, 12:59pm UTC](https://www.ruby-forum.com/t/large-uploads-with-attchment-fu/157446/2 "2009-01-11T12:59:07Z")

</div>

On 11 Jan 2009, at 12:51, Richard wrote:

> I am trying to upload 30mb files with attachment-fu, these seem to  
> just hang. (works file for small image files)  
> I am using mongrel cluster and nginx…
> 
> Does anyone have any advice?

Check your nginx conf file and set the client\_max\_body property to  
something higher:

client\_max\_body\_size 50M;

It could probably be a number of other things too, but your  
information is so limited it’s just guess work. Try and isolate the  
problem to either your rails app, mongrel or nginx.

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![r-a-mueller](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/dfb087/32.png) [@r-a-mueller](https://www.ruby-forum.com/u/r-a-mueller)\
**Post date:** [January 11, 2009, 12:59pm UTC](https://www.ruby-forum.com/t/large-uploads-with-attchment-fu/157446/3 "2009-01-11T12:59:07Z")

</div>

maybe you got a limit in your database. you could set  
max\_allowed\_packet = 32M

look here: [http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html](http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html)

---

<div class="post-metadata">

**Author:** ![r-a-mueller](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/dfb087/32.png) [@r-a-mueller](https://www.ruby-forum.com/u/r-a-mueller)\
**Post date:** [January 12, 2009, 12:41am UTC](https://www.ruby-forum.com/t/large-uploads-with-attchment-fu/157446/4 "2009-01-12T00:41:04Z")

</div>

Peter,

Thanks for your reply, yes I should have posted the nginx.conf  
contents.

But yes you were right.

It was the client\_max\_body\_size, I changed this in the nginx.conf then  
it worked!

Thanks so much for your help.

Richard

---

<div class="post-metadata">

**Author:** ![r-a-mueller](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/dfb087/32.png) [@r-a-mueller](https://www.ruby-forum.com/u/r-a-mueller)\
**Post date:** [January 12, 2009, 12:43am UTC](https://www.ruby-forum.com/t/large-uploads-with-attchment-fu/157446/5 "2009-01-12T00:43:59Z")

</div>

Thanks for the reply,

As Peter suggested I didn’t write enough about my problem, I was no  
actually saving my file into the database, I was saving into the file  
system. But thanks for the advice. On a db based file save your answer  
may have been another reason also.

All the best

Richard
