Reputation: 413
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?
Upvotes: 1
Views: 1944
Reputation: 1552
Please try absolute path in $destinationPath as C:\Mysecondproject\public\src\img\upload
or D:\Mysecondproject\public\src\img\upload
.
Upvotes: 2