I have two laravel
project i use code in my Myfirstproject
to upload to Mysecondproject
public\\src\\img\\upload directory
.
I try these code in Myfirstproject:
if ($request->hasFile('images')) {
$destinationPath='Mysecondproject\public\src\img\upload';
if ($files = $request->file('images')) {
foreach ($files as $file) {
$name = $file->getClientOriginalName();
$file->move($destinationPath, $name);
$images[] = $name;
}
}
}
But it's not working, any solution for these?
请尝试$ destinationPath中的绝对路径作为C:\\Mysecondproject\\public\\src\\img\\upload
或D:\\Mysecondproject\\public\\src\\img\\upload
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.