diff options
author | Zeev Suraski <zeev@php.net> | 1999-05-25 22:28:24 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 1999-05-25 22:28:24 +0000 |
commit | cf58b7ef1615d2456fc2e3aa9319d8aae11f880f (patch) | |
tree | 921299e2eabdc7f9c3650fbdc9ec86b154856081 /main/rfc1867.c | |
parent | 6155d91e7a508a067536ff5124b08eca87209e46 (diff) | |
download | php-git-cf58b7ef1615d2456fc2e3aa9319d8aae11f880f.tar.gz |
Add container for file-upload. It's not quite implemented yet.
Diffstat (limited to 'main/rfc1867.c')
-rw-r--r-- | main/rfc1867.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/main/rfc1867.c b/main/rfc1867.c new file mode 100644 index 0000000000..aba13d1b60 --- /dev/null +++ b/main/rfc1867.c @@ -0,0 +1,24 @@ +#include "rfc1867.h" + +SAPI_POST_READER_FUNC(rfc1867_post_reader) +{ + char *boundary; + uint boundary_len; + char input_buffer[FILE_UPLOAD_INPUT_BUFFER_SIZE]; + uint read_bytes; + + boundary = strstr(content_type_dup, "boundary"); + if (!boundary || !(boundary=strchr(boundary, '='))) { + sapi_module.sapi_error(E_COMPILE_ERROR, "Missing boundary in multipart/form-data POST data"); + return; + } + boundary++; + boundary_len = strlen(boundary); + + for (;;) { + read_bytes = sapi_module.read_post(input_buffer, FILE_UPLOAD_INPUT_BUFFER_SIZE-100 SLS_CC); + if (read_bytes<=0) { + break; + } + } +} |