Forum: Ruby on Rails getting 500 internal server error on upload

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B0f4222e356ae5276fa83f3078f074be?d=identicon&s=25 Priya (Guest)
on 2009-01-10 13:33
(Received via mailing list)
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'%>

  <input type="reset" value="Clear">
  <%= 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,
This topic is locked and can not be replied to.