# Upload problems

**URL:** <https://www.ruby-forum.com/t/upload-problems/117005>\
**Category:** Rails\
**Created:** [October 12, 2007, 12:57am UTC](https://www.ruby-forum.com/t/upload-problems/117005 "2007-10-12T00:57:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brunopreis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/97f17d/32.png) [@brunopreis](https://www.ruby-forum.com/u/brunopreis)\
**Post date:** [October 12, 2007, 12:57am UTC](https://www.ruby-forum.com/t/upload-problems/117005/1 "2007-10-12T00:57:09Z")

</div>

Hi all,

when I try to upload a file with 200kb or less, rails does it fine.  
But when I try a bigger one, I get the following error:

ActiveRecord::StatementInvalid in ConteudoController#enviar\_imagem

Mysql::Error: Lost connection to MySQL server during query: INSERT  
INTO conteudo\_imagem (`comentario`, `nome`, `conteudo_id`, `ordem`,  
`tipo`, `data`) VALUES(’’, ‘5.png’, 49, 8, ‘image/png’,  
x’89504e…

Is there a configuration I should do? What is wrong?

thks

Bruno R.

---

<div class="post-metadata">

**Author:** ![brunopreis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/97f17d/32.png) [@brunopreis](https://www.ruby-forum.com/u/brunopreis)\
**Post date:** [October 12, 2007, 12:48pm UTC](https://www.ruby-forum.com/t/upload-problems/117005/2 "2007-10-12T12:48:10Z")

</div>

I remember reading (a while back) that rails handles small and large  
files different…

On a quick search I found this…

[http://blog.vixiom.com/2006/07/26/rails-stringio-file-upload/](http://blog.vixiom.com/2006/07/26/rails-stringio-file-upload/)

but there is better info… hope this points you in the right  
direction
