# No file uploads possible with mongrel?

**URL:** <https://www.ruby-forum.com/t/no-file-uploads-possible-with-mongrel/186720>\
**Category:** Mongrel\
**Created:** [April 12, 2010, 7:11am UTC](https://www.ruby-forum.com/t/no-file-uploads-possible-with-mongrel/186720 "2010-04-12T07:11:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![logicat2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eada6e/32.png) [@logicat2001](https://www.ruby-forum.com/u/logicat2001)\
**Post date:** [April 12, 2010, 7:11am UTC](https://www.ruby-forum.com/t/no-file-uploads-possible-with-mongrel/186720/1 "2010-04-12T07:11:51Z")

</div>

Hello all!

I am using mongrel in several production environments and it is working  
great! Now I have to put up some really large files (html multipart, no  
plugin used, some hundret Mb). The only thing I can produce with mongrel  
is:

Sun Apr 11 06:13:21 +0000 2010: Error reading HTTP body: #\<RuntimeError:  
Socket read returned insufficient data: 3374\>  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel/http\_request.rb:107:in  
`read_socket' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/http_request.rb:86:in`read\_body’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel/http\_request.rb:55:in  
`initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:149:in`new’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel.rb:149:in  
`process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in`run’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel.rb:285:in  
`initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in`new’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel.rb:285:in  
`run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in`initialize’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel.rb:268:in  
`new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in`run’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel/configurator.rb:282:in  
`run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in`each’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel/configurator.rb:281:in  
`run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in`run’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel/command.rb:212:in  
`run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 /usr/bin/mongrel_rails:19:in`load’  
/usr/bin/mongrel\_rails:19

Any ideas? alternatives?

Thank you VERY much in advance!

Regards,  
Anton

---

<div class="post-metadata">

**Author:** ![logicat2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eada6e/32.png) [@logicat2001](https://www.ruby-forum.com/u/logicat2001)\
**Post date:** [April 12, 2010, 3:37pm UTC](https://www.ruby-forum.com/t/no-file-uploads-possible-with-mongrel/186720/2 "2010-04-12T15:37:42Z")

</div>

On Mon, Apr 12, 2010 at 1:59 AM, Anton T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run’  
> /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel\_rails:281  
> /usr/bin/mongrel\_rails:19:in `load’  
> /usr/bin/mongrel\_rails:19
> 
> Any ideas? alternatives?

If you’re mentioning hundred of megabytes it might be possible that  
the Ruby instance is not able to handle the file properly.

Would be great if you can isolate this to a real minimum mongrel  
handler example instead of a Rails application.

I had successfully uploaded big files with mongrel, but honestly never  
tried to upload 200mb or similar because will be suboptimal.

## – Luis L. AREA 17

Perfection in design is achieved not when there is nothing more to add,  
but rather when there is nothing more to take away.  
Antoine de Saint-Exupéry

---

<div class="post-metadata">

**Author:** ![logicat2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eada6e/32.png) [@logicat2001](https://www.ruby-forum.com/u/logicat2001)\
**Post date:** [September 2, 2010, 3:28pm UTC](https://www.ruby-forum.com/t/no-file-uploads-possible-with-mongrel/186720/3 "2010-09-02T15:28:11Z")

</div>

Luis L. wrote:

> On Mon, Apr 12, 2010 at 1:59 AM, Anton T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run’  
> > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel\_rails:281  
> > /usr/bin/mongrel\_rails:19:in `load’  
> > /usr/bin/mongrel\_rails:19
> > 
> > Any ideas? alternatives?
> 
> If you’re mentioning hundred of megabytes it might be possible that  
> the Ruby instance is not able to handle the file properly.
> 
> Would be great if you can isolate this to a real minimum mongrel  
> handler example instead of a Rails application.
> 
> I had successfully uploaded big files with mongrel, but honestly never  
> tried to upload 200mb or similar because will be suboptimal.
> 
> ## – Luis L. AREA 17
> 
> Perfection in design is achieved not when there is nothing more to add,  
> but rather when there is nothing more to take away.  
> Antoine de Saint-Exupé²¹

hii,  
i am trying to upload some files to filesystem using rails application  
when i use small size file everything is perfect but i when goes for  
larger files i got error  
this is my code

#this model file  
class DataFile \< ActiveRecord::Base

def self.save(upload)  
name = upload[‘datafile’].original\_filename  
directory = “[//192.168.147.17/Smruti/streams](https://192.168.147.17/Smruti/streams)”  
# create the file path  
path = File.join(directory, name)  
# write the file  
File.open(path, “wb”) { |f| f.write(upload[‘datafile’].read) }  
end  
end

#this is my controller  
class UploadController \< ApplicationController  
def index  
render :file =\> ‘app\views\upload\uploadfile.rhtml’  
end  
def uploadFile  
post = DataFile.save(params[:upload])  
render :text =\> “File has been uploaded successfully”  
end  
end

---

<div class="post-metadata">

**Author:** ![logicat2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eada6e/32.png) [@logicat2001](https://www.ruby-forum.com/u/logicat2001)\
**Post date:** [September 3, 2010, 2:19pm UTC](https://www.ruby-forum.com/t/no-file-uploads-possible-with-mongrel/186720/4 "2010-09-03T14:19:13Z")

</div>

Luis L. wrote:

> On Mon, Apr 12, 2010 at 1:59 AM, Anton T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run’  
> > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel\_rails:281  
> > /usr/bin/mongrel\_rails:19:in `load’  
> > /usr/bin/mongrel\_rails:19
> > 
> > Any ideas? alternatives?
> 
> If you’re mentioning hundred of megabytes it might be possible that  
> the Ruby instance is not able to handle the file properly.
> 
> Would be great if you can isolate this to a real minimum mongrel  
> handler example instead of a Rails application.
> 
> I had successfully uploaded big files with mongrel, but honestly never  
> tried to upload 200mb or similar because will be suboptimal.
> 
> ## – Luis L. AREA 17
> 
> Perfection in design is achieved not when there is nothing more to add,  
> but rather when there is nothing more to take away.  
> Antoine de Saint-Exupé²¹

yaa luis  
i am sending form with mutipart true option  
like  
\<%= form\_tag ({:action =\> ‘uploadFile’},:multipart =\> true) %\>
