# raw post data

- Thread: https://externals.io/message/5378
- Original archive: https://news-web.php.net/php.internals/5378
- Started by Andi Gutmans on 2003-11-12T08:31:50+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #5378 — Andi Gutmans — 2003-11-12T08:31:50+00:00

URL: https://externals.io/message/5378#5378

Any chance we can make the necessary changes to support an upload progress 
bar? I came accross this web site but I'm not quite sure if always 
populating RAW_POST_DATA is enough.
http://www.raditha.com/php/progress.php

Andi

---

## #5379 — Rasmus Lerdorf — 2003-11-12T08:34:51+00:00

URL: https://externals.io/message/5378#5379 · In reply to: #5378

Patches to do this have been posted here a couple of times, nobody was 
interested.

As for always populating the raw post data.  See the aptly named 
always_populate_raw_post_data php.ini setting.

-Rasmus



> Any chance we can make the necessary changes to support an upload progress 
> bar? I came accross this web site but I'm not quite sure if always 
> populating RAW_POST_DATA is enough.
> http://www.raditha.com/php/progress.php
> 
> Andi

---

## #5627 — Hartmut Holzgraefe — 2003-11-21T03:04:09+00:00

URL: https://externals.io/message/5378#5627 · In reply to: #5378

Andi Gutmans wrote:
> Any chance we can make the necessary changes to support an upload 
> progress bar? I came accross this web site but I'm not quite sure if 
> always populating RAW_POST_DATA is enough.
> http://www.raditha.com/php/progress.php

RAW_POST_DATA won't help at all here as PHP user code execution
won't start until all incoming request data had been read and
stored in the special variable

their "change the from content type to something unknown" might
work if they'd use the php://input stream instead though ...

-- 
Hartmut Holzgraefe  <hartmut@php.net

---

## #5629 — Doru Petrescu — 2003-11-21T07:54:00+00:00

URL: https://externals.io/message/5378#5629 · In reply to: #5627

> Andi Gutmans wrote:
> > […]
> 
> RAW_POST_DATA won't help at all here as PHP user code execution
> won't start until all incoming request data had been read and
> stored in the special variable
> 
> their "change the from content type to something unknown" might
> work if they'd use the php://input stream instead though ...
> 
> -- 
> Hartmut Holzgraefe  <hartmut@php.net>


I don't think this will help either as PHP always read the entire
content-length BEFORE even loading the actual php script. As long as you
using php as a web server module you cannot escape this.

if you need to run something while the data is received we need to
change the way php works. the way I see things is to put hook in the 
function that read the data from the client. This will allow execution
of code while post data is received.

and it happens that such feature was already suggested by me together
with a patch yesterday ... see my email 'upload-progress-tracking'



-- 


Best regards,
Doru Petrescu
Senior Software Engineer
Astral Telecom Bucuresti

---

## #5646 — Hartmut Holzgraefe — 2003-11-21T18:11:24+00:00

URL: https://externals.io/message/5378#5646 · In reply to: #5629

Doru Petrescu wrote:
> I don't think this will help either as PHP always read the entire
> content-length BEFORE even loading the actual php script. As long as you
> using php as a web server module you cannot escape this.

this is true if either RAW_POST_DATA is populated or a post
handler for the mime type of the POST request is activated,
for POST requests that come with a mime type we have no handler
registered for i am not sure right now ...

> if you need to run something while the data is received we need to
> change the way php works. the way I see things is to put hook in the 
> function that read the data from the client. This will allow execution
> of code while post data is received.

i already did (in a way) by introducing the php://input stream in
PHP 4.3.0, although it actually is more about PUT than POST ...

-- 
Hartmut Holzgraefe  <hartmut@php.net
