Req #76444 [Opn]: can't read stream from multipart requests
| From: | cmb@php.net | Date: | Tue, 27 Jul 2021 12:05:50 +0000 |
| Subject: | Req #76444 [Opn]: can't read stream from multipart requests | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-235400@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76444&edit=1
ID: 76444
Updated by: cmb@php.net
Reported by: clark at electrobeat dot dk
Summary: can't read stream from multipart requests
Status: Open
Type: Feature/Change Request
Package: Streams related
Operating System: debian stretch
PHP Version: 7.0.30
Block user comment: N
Private report: N
New Comment:
Related to request #48219.
Previous Comments:
------------------------------------------------------------------------
[2018-06-11 09:59:56] requinix@php.net
By "brand new idea" I meant that I've never heard of anyone needing a way to do that,
let alone knowing how to.
And looking through the code, I don't see a way to do it.
But I think I see a possible workaround when using nginx and php-fpm: have nginx write the request
body to a file (client_body_in_file_only=clean), pass the filename as a CGI environment variable
(fastcgi_param REQUEST_BODY_FILE $request_body_file) which PHP will recognize, then you can open and
read the file in code too.
------------------------------------------------------------------------
[2018-06-11 09:29:01] clark at electrobeat dot dk
could anyone please remove the URL in the description to my server..
------------------------------------------------------------------------
[2018-06-11 09:28:19] clark at electrobeat dot dk
Is it possible to get the headers from the parts of a multipart request?
------------------------------------------------------------------------
[2018-06-11 09:07:37] requinix@php.net
It hasn't been fixed because it isn't a bug.
http://php.net/manual/en/wrappers.php.php
> php://input is not available with enctype="multipart/form-data".
File upload requests are often large. They can't necessarily be buffered to memory, though
buffering to a temp file would probably be a reasonable fallback. And obviously being a data stream
so it's not naturally seekable.
But it sounds like what you really want is to get the multipart headers. AFAIK that's a brand
new idea.
------------------------------------------------------------------------
[2018-06-11 08:26:00] clark at electrobeat dot dk
want to delete the url to my server
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=76444
--
Edit this bug report at https://bugs.php.net/bug.php?id=76444&edit=1