Verified Commit 0677a536 authored by Cyril Vazquez's avatar Cyril Vazquez
Browse files

Get file handler for received files

parent b4342f7d
Pipeline #18842 failed with stages
in 28 seconds
......@@ -195,7 +195,11 @@ class HttpRequest
foreach ($_FILES as $name => $item) {
// Standard form-data files at root level
if (is_string($item['name'])) {
$files[$name] = $item;
$file = $item;
if ($file['error'] == 0) {
$file['handler'] = fopen($file['tmp_name'], 'r');
}
$files[$name] = $file;
continue;
}
......@@ -211,7 +215,11 @@ class HttpRequest
foreach ($keys as $key) {
$file[$key] = $item[$key][$fname];
}
if ($file['error'] == 0) {
$file['handler'] = fopen($file['tmp_name'], 'r');
}
$files[$name][$fname] = $file;
continue;
}
......@@ -222,6 +230,9 @@ class HttpRequest
foreach ($keys as $key) {
$file[$key] = $item[$key][$fname][$index];
}
if ($file['error'] == 0) {
$file['handler'] = fopen($file['tmp_name'], 'r');
}
$files[$name][$fname][$index] = $file;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment