FileUploadHandler not called in realtime

50 views
Skip to first unread message

TK

unread,
Mar 2, 2009, 2:40:21 PM3/2/09
to Django users
Hi,
I've got a problem with limiting the maximum size of a file uploaded
to my webapp. I subclassed FileUploadHandler and everything is working
fine, but only with Django development server.

When running on lighttpd or nginx with mod_fastcgi (actually it
behaves the same with apache + mod_python) my 'new_file' and
'receive_data_chunk' methods are called *after* whole request has been
uploaded to the server... And my intention is to raise SkipFile/
StopUpload when uploaded data exceeds 100 kB or it's not an image.

That leads me to believe, that lighty and/or fastcgi are buffering the
requests before passing them on to Django. Therefore my question is:
under which web server is it possible to use the features given to us
by UploadHandlers and chunked uploads? Or even better still: how to
disable buffering POST requests in Lighttpd?

I asked that question on the Lighty support forums (http://
redmine.lighttpd.net/boards/2/topics/925), but without any answer.
Actually there is a bug in Lighttpd, marked as fixed, concerning just
the issue (http://redmine.lighttpd.net/issues/59), but I can find no
information altogether about it.

Hope you might be able to help me :-)

Best regards,
Tomasz Kopczuk.

legutierr

unread,
Apr 17, 2009, 1:54:53 AM4/17/09
to Django users
I am experiencing exactly the same problem with Apache running against
FastCGI on a Mac. It would seem that the problem is on the Django
side, not on the webserver side if this is the case.

Thomasz- Have you figured out a solution to this problem? Did you log
a bug in the defect tracker?

TK

unread,
Apr 20, 2009, 4:00:05 PM4/20/09
to Django users
legutierr <leguti...@gmail.com> wrote:
> Thomasz- Have you figured out a solution to this problem?  Did you log
> a bug in the defect tracker?

No and no. Never thought it might be connected to Django in any way if
it's already in the docs and everything. Might well be worth a try. I
will file a bug report today.

Let us know here please if You find any solution. I will keep you
updated in this thread as well.

Best regards,
Tomasz Kopczuk
Reply all
Reply to author
Forward
0 new messages