Skip to content
New issue

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

上传多文件的情况,该怎么处理呢? #21

Open
naibacaixiang opened this issue Oct 6, 2018 · 2 comments
Open

上传多文件的情况,该怎么处理呢? #21

naibacaixiang opened this issue Oct 6, 2018 · 2 comments

Comments

@naibacaixiang
Copy link

请教一下。 我从input表单里取到了多个上传文件
$files = $request->file('img');

打印$files 的话是个数组

array:2 [▼
0 => UploadedFile {#489 }
1 => UploadedFile {#490 }
]
想获取到里面的每一个上传文件
用了foreach循环

foreach ($files as $file){
dd($file);
}
取不到所有上传文件。

@Everan-1994
Copy link

@naibacaixiang 循环里面 dd 一次就 die 掉了,所以不显示全部文件。

@naibacaixiang
Copy link
Author

@naibacaixiang 循环里面 dd 一次就 die 掉了,所以不显示全部文件。

非常感谢,已解决。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants