# Getting 500 internal server error on upload

**URL:** <https://www.ruby-forum.com/t/getting-500-internal-server-error-on-upload/157390>\
**Category:** Rails\
**Created:** [January 10, 2009, 1:33pm UTC](https://www.ruby-forum.com/t/getting-500-internal-server-error-on-upload/157390 "2009-01-10T13:33:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![priya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/eada6e/32.png) [@priya](https://www.ruby-forum.com/u/priya)\
**Post date:** [January 10, 2009, 1:33pm UTC](https://www.ruby-forum.com/t/getting-500-internal-server-error-on-upload/157390/1 "2009-01-10T13:33:18Z")

</div>

Hi all ,

I have a application where i try to upload a csv file and parse the  
input.  
I am getting “500 internal server error” after clicking upload.  
However the file got uploaded correctly at the destination location. I  
am using Lighttpd - FastCGI server. At looking into the server logs i  
found the error was due to “Malformed multipart post”

## Form view

\<% form\_tag ({:controller=\>“admin” , :action =\>  
“csv\_upload” }, :multipart =\> true )do %\>  
\<%=file\_field\_tag ‘attachment’%\>

## \<%= submit\_tag(‘Upload’, :name =\> ‘submit’) %\>

# fcgi error.log

2009-01-10 04:13:35: (mod\_fastcgi.c.2593) FastCGI-stderr: Malformed  
multipart POST  
Malformed multipart POST

## 2009-01-10 04:17:39: (mod\_fastcgi.c.1744) connect failed: Connection refused on

# my lighttpd config

## server.modules += ( “mod\_fastcgi” ) fastcgi.server += ( “dispatch.fcgi” =\> ( “localhost” =\> ( “bin-path” =\> “\<%= $root %\>/bin/rails\_dispatcher.fcgi”, “socket” =\> “\<%= $root %\>/var/state/fcgi-\<%= $port %\>.sock”, “check-local” =\> “disable”, “mode” =\> “responder”, “min-procs” =\> 1, “max-procs” =\> 15, “idle-timeout” =\> 300, “upload-dirs” =\> “/var/tmp”, “max-request-size” =\> 10000 , “bin-environment” =\> ( “APOLLO\_ROOT” =\> “\<%= $root %\>”, “RAILS\_ROOT” =\> “\<%= $root %\>/rails-root”, “RAILS\_ENV” =\> “development” ), “bin-copy-environment” =\> ( “” ) ))) fastcgi.debug = 1 debug.log-request-handling = “enable” server.error-handler-404 = “/rails.fcgi”

Can somebody please help me with the problem ? I have extensive  
googling , but unable to find any solution.

Thank you,
