简体   繁体   中英

How to upload image from one project to another project laravel

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\\uploadD:\\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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM