Lighttpd file upload issue - sporadic choke?


#1

This has been driving me crazy: I have a file upload controller/view
that finally uploads a file with this code in the controller:

File.open("#{filepath}/#{filename}", “wb”) do |f|
f.write(@params[:document][:file].read)
end

This works great for files large and small in webbrick and in on an
Apache/FastCGI setup. However, on my production box which is running
Lighttpd 1.4.7, this functionality fails about 50% of the time for
files over 100 KB. When I say ‘fail’, I mean that the file just never
appears in “#{filepath}/#{filename}”. The f.write command does not
throw an error and no errors appear in log/production.log,
log/fastcgi.crash.log or the lighttpd_error.log. Very odd.

Is there some Lighttpd directive regarding upload file size I need to
include in my .conf file? Some multipart chunk thing I need to know
about? How should I go about getting to the bottom of this? (Please! I
dread wrestling with FastCGI/Apache again.)

Your help/suggestions are greatly appreciated.


#2

I have the same issue, after 100K I have problem. Anybody has any idea?
I work with file_column + imagemagick

Any answer on this?

Henry P. wrote:

This has been driving me crazy: I have a file upload controller/view
that finally uploads a file with this code in the controller:

File.open("#{filepath}/#{filename}", “wb”) do |f|
f.write(@params[:document][:file].read)
end

This works great for files large and small in webbrick and in on an
Apache/FastCGI setup. However, on my production box which is running
Lighttpd 1.4.7, this functionality fails about 50% of the time for
files over 100 KB. When I say ‘fail’, I mean that the file just never
appears in “#{filepath}/#{filename}”. The f.write command does not
throw an error and no errors appear in log/production.log,
log/fastcgi.crash.log or the lighttpd_error.log. Very odd.

Is there some Lighttpd directive regarding upload file size I need to
include in my .conf file? Some multipart chunk thing I need to know
about? How should I go about getting to the bottom of this? (Please! I
dread wrestling with FastCGI/Apache again.)

Your help/suggestions are greatly appreciated.


#3

Gokhan A. wrote:

I have the same issue, after 100K I have problem. Anybody has any idea?
I work with file_column + imagemagick

Any answer on this?

For me the answer was to clear the cache I had stowed in
lib/image_upload_cache, make sure permissions were correct everywhere,
clearing all past ruby session files and restarting the server. I’m not
sure where file_column caches things, but I would try and find out and
clear it out. HTH


#4

Hi Henry,

I was hitting an upload limit of 4mb, which was solved on the latest
lighty release, 1.4.8. Also, if you’re using Safari (I believe there
some issues with IE/PC as well), it might be worth adding this to your
lighttpd.conf:

$HTTP[“useragent”] =~ “^(.MSIE.)|(.AppleWebKit.)$” {
server.max-keep-alive-requests = 0
}

Safari would choke on uploads above 64K, there was a thread about this
on textdrive i think

  • Oliver

2005/12/14, Henry P. removed_email_address@domain.invalid:


#5

(not sure whether the keep-alive-requests was solved on 1.4.8, btw…
might have)

2005/12/15, Oliver B. removed_email_address@domain.invalid: