Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-09-18, o godz. 13:47, przez Graham Dumpleton: I saw actual request bodies larger than declared in content-lentgh with Firefox 2, this browser often was lying to my nginx in cases of small bodies by 1-4 bytes. >> >>> What sort of application w

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Graham Dumpleton
On Sep 18, 9:41 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Wiadomość napisana w dniu 2008-09-18, o godz. 13:33, przez Graham   > Dumpleton: > > > > >> Now, where on earth have you got this idea that you can not   > >> rely on > >>> Content-Length on a request? > > >> I saw actual reque

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-09-18, o godz. 13:33, przez Graham Dumpleton: >> Now, where on earth have you got this idea that you can not >> rely on >>> Content-Length on a request? >> >> I saw actual request bodies larger than declared in content-lentgh >> with Firefox 2, this brow

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Donn
On Thursday, 18 September 2008 13:17:06 Graham Dumpleton wrote: > If Content-Length was an unreliable indicator of request content then > web applications wouldn't work properly. Okay, in context of the OP's code -- how could I employ content length and get an error message back to the admin cha

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Graham Dumpleton
On Sep 18, 9:28 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Wiadomość napisana w dniu 2008-09-18, o godz. 13:17, przez Graham   > Dumpleton: > > > > If using mod_python, the Apache LimitRequestBody directive doesn't > work entirely properly. > >>> I have heard of a "Content-length" vari

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-09-18, o godz. 13:17, przez Graham Dumpleton: If using mod_python, the Apache LimitRequestBody directive doesn't work entirely properly. >>> I have heard of a "Content-length" variable (from PHP, but it's an >>> http >>> thing) -- how could I use that? r

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Graham Dumpleton
On Sep 18, 8:56 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Wiadomość napisana w dniu 2008-09-18, o godz. 13:01, przez Donn: > > >> If using mod_python, the Apache LimitRequestBody directive doesn't > >> work entirely properly. > > I have heard of a "Content-length" variable (from PHP, but it's

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-09-18, o godz. 13:01, przez Donn: >> If using mod_python, the Apache LimitRequestBody directive doesn't >> work entirely properly. > I have heard of a "Content-length" variable (from PHP, but it's an > http > thing) -- how could I use that? request["Content-length

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Donn
On Thursday, 18 September 2008 12:13:12 Graham Dumpleton wrote: > If using mod_python, the Apache LimitRequestBody directive doesn't > work entirely properly. I have heard of a "Content-length" variable (from PHP, but it's an http thing) -- how could I use that? request["Content-length"] or somet

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Graham Dumpleton
On Sep 18, 7:35 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Better to set the upload filesize limit on your server eg Apache's has > a directive for max file size. Otherwise the file will be uploaded and > checked anyway. If using mod_python, the Apache LimitRequestBody directive doesn

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Donn
On Wednesday, 17 September 2008 23:35:46 [EMAIL PROTECTED] wrote: > Better to set the upload filesize limit on your server eg Apache's has > a directive for max file size. Otherwise the file will be uploaded and > checked anyway. I will look into this, but not sure how Apache will respond on the

Re: FileSystemStorage preventing large file uploads

2008-09-17 Thread [EMAIL PROTECTED]
Better to set the upload filesize limit on your server eg Apache's has a directive for max file size. Otherwise the file will be uploaded and checked anyway. If you want to report an error to the user you could use validation on the form. The code below returns a error if a file extension is not

FileSystemStorage preventing large file uploads

2008-09-14 Thread Donn
Hi, Some code is below. I am in my FileSystemStorage class and I want to prevent users from uploading images over 100K. There are 2 questions here: 1. Is my use of len(content) sensible? I don't have a file yet, only a memory object, so I can't use stat. 2. How would I raise an error so that it