We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
thinkphp5.1.34 使用 Request::file() 获取上传的全部文件, 框架抛出异常,但是使用$_POST可以获取到正确的参数,异常如下: [8] ErrorException in Request.php line 1214 未定义数组下标: 0 foreach ($files as $key => $file) { if ($file instanceof File) { $array[$key] = $file; } elseif (is_array($file['name'])) { $item = []; $keys = array_keys($file); $count = count($file['name']);
for ($i = 0; $i < $count; $i++) { if ($file['error'][$i] > 0) { if ($name == $key) { $this->throwUploadFileError($file['error'][$i]); } else { continue; } } $temp['key'] = $key;
请求参数如下:
curl -X POST http://www.tp51.local/file/file/save -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' -F 'img[data1]=@C:\Users\Public\Pictures\Sample Pictures\Desert.jpg' -F 'img[data2]=@C:\Users\Public\Pictures\Sample Pictures\Hydrangeas.jpg'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
thinkphp5.1.34 使用 Request::file() 获取上传的全部文件, 框架抛出异常,但是使用$_POST可以获取到正确的参数,异常如下:
[8] ErrorException in Request.php line 1214
未定义数组下标: 0
foreach ($files as $key => $file) {
if ($file instanceof File) {
$array[$key] = $file;
} elseif (is_array($file['name'])) {
$item = [];
$keys = array_keys($file);
$count = count($file['name']);
请求参数如下:
curl -X POST
http://www.tp51.local/file/file/save
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
-F 'img[data1]=@C:\Users\Public\Pictures\Sample Pictures\Desert.jpg'
-F 'img[data2]=@C:\Users\Public\Pictures\Sample Pictures\Hydrangeas.jpg'
The text was updated successfully, but these errors were encountered: