Re: How to find uploaded data size from content-length
- From: xhoster@xxxxxxxxx
- Date: 19 Apr 2006 19:52:30 GMT
John Bokma <john@xxxxxxxxxxxxxxx> wrote:
xhoster@xxxxxxxxx wrote:
John Bokma <john@xxxxxxxxxxxxxxx> wrote:
Asterbing <no@xxxxxxxxxx> wrote:
In article <Xns97AA6D15AEC7Fcastleamber@xxxxxxxxxxx>,
john@xxxxxxxxxxxxxxx says...
Why not -s filename assuming you store it in a file system?
Because I would like to avoid too big files
Ok, so your question actually is: how do I avoid the uploading of big
files:
$CGI::POST_MAX
If set to a non-negative integer, this variable puts a ceiling on
the
size of POSTings, in bytes. If CGI.pm detects a POST that is greater
than the ceiling, it will immediately exit with an error message.
That should probaby be changed. It does not immediately exit with
an error message. It first reads (and discards) the entire contents
of the POST, which apparently the OP doesn't want to happen althought
it is kind of hard to figure out exactly what he wants. Also, it
doesn't exit at all. It causes param to return an empty param list,
and it causes cgi_error to return an error message--no exiting
involved.
You mean it reads until it detects that the max size has been reached?
No. It compares CONTENT_LENGTH to POST_MAX. If CONTENT_LENGTH is greater
than POST_MAX, then it reads the entire post, but doesn't do anything with
it (doesn't parse it, doesn't save it to disk, just reads and throws away
in chunks.) If CONTENT_LENGTH is less than POST_MAX, it reads the post
and parses it (saving parts of it to disk, if appropriate.)
Yes, that's what I expect, since one can keep streaming bytes, and only
when the max has been reached the script knows it was too much.
But AFAICT, it doesn't do it this way. It seems to trust CONTENT_LENGTH
absolutely, and if CONTENT_LENGTH is wrong it does nothing to detect this.
The second part: if the documentation is wrong, it must be fixed. Did you
submit this?
I haven't yet. I'm not sure how I would recommend changing it. The
read-but-discard thing may be an (only sometimes important) implementation
detail that does not need to be documented. The "immediate exit" is
clarified later on the documention, and I'm not sure how to clarify here
also without causing bloat.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.
- References:
- How to find uploaded data size from content-length
- From: Asterbing
- Re: How to find uploaded data size from content-length
- From: John Bokma
- Re: How to find uploaded data size from content-length
- From: Asterbing
- Re: How to find uploaded data size from content-length
- From: John Bokma
- Re: How to find uploaded data size from content-length
- From: xhoster
- Re: How to find uploaded data size from content-length
- From: John Bokma
- How to find uploaded data size from content-length
- Prev by Date: Re: Creating 1 file w/ the contents of 7 other files mixed randomly.
- Next by Date: fatal: relocation error: symbol dirty?
- Previous by thread: Re: How to find uploaded data size from content-length
- Next by thread: Re: How to find uploaded data size from content-length
- Index(es):
Relevant Pages
|