Forum: Rails deployment dispatch.fcgi && lighttpd file 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.
shai (Guest)
on 2007-05-13 17:37
Hi,

as i'm aware that there are not too many out there still using
dispatch.fcgi && lighttpd (rather moving to mongrels && nginx ) , i'll
try to make this simple:

how do i limit a file upload size in lighttpd? am i supposed to do this
via the app? i've racked the internet for a while now, and my mind is
heavy and stumped.

i'm running dispatch.fcgi && lighttpd as the web-server.

any help or references would be greatly appreciated.
thanks.
ajay (Guest)
on 2007-05-14 12:44
(Received via mailing list)
Hi,

I still use dispatch.fcg && lighttpd.

Here are two things I do -

1. Lighttpd config server.max-request-size option

 http://trac.lighttpd.net/trac/wiki/server.max-requ...

2. In the app I use the file_column plugin (http://www.kanthak.net/
opensource/file_column/) for file uploads and use the following in my
model.

 validates_filesize_of :image, :in => 5.kilobytes..2.5.megabyte

Hope this helps.

Cheers,

Ajay
shai (Guest)
on 2007-05-15 12:26
ajay wrote:
> Hi,
>
> I still use dispatch.fcg && lighttpd.
>
> Here are two things I do -
>
> 1. Lighttpd config server.max-request-size option
>
>  http://trac.lighttpd.net/trac/wiki/server.max-requ...
>
> 2. In the app I use the file_column plugin (http://www.kanthak.net/
> opensource/file_column/) for file uploads and use the following in my
> model.
>
>  validates_filesize_of :image, :in => 5.kilobytes..2.5.megabyte
>
> Hope this helps.
>
> Cheers,
>
> Ajay

many thanks! i'll check this out in a sec;
just as a note; i was having trouble beforehand on a different issue -
serving the css's + gifs + static content straight via lighttpd rather
than going through dispatch; this works like a charm: (sped up my app)

lighttpd.conf
============================
...
...

url.rewrite = ("^/$" => "index.html", "^([^.]+)$" => "$1.html",
# this following line serves the static content via lighttpd rather than
# sending it to the dispatch, and then serving it ...
                                "^(.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|mov)(\?(v=|ver=)?\d+)?)$"
=> "$1" )

later && thanks,

shai
shai (Guest)
on 2007-05-15 13:00
>>  validates_filesize_of :image, :in => 5.kilobytes..2.5.megabyte

do i need rmagick for this? or is file_column plugin enough (this is my
case)?
ajay (Guest)
on 2007-05-17 14:37
(Received via mailing list)
hmm... my understanding is that validates_filesize_of doesn't require
rmagick but validates_image_size does.
This topic is locked and can not be replied to.