James Parsons
James Parsons

Reputation: 925

Moving files in Laravel 5.2 using Storage::move

I am looking to move files in Laravel 5.2 using Storage::move. The code I am using is below:

$file = basename($m);
            $new_path= base_path('mailbox_archive/'.$file);

Storage::move($m, $new_path);

I am getting the following error message:

[League\Flysystem\FileNotFoundException]
File not found at path: Users/JamesParsons/Dropbox/virtual/mailbox/17_10-08
-16_20-49-17.json

The paths are as follows:

$m=/Users/JamesParsons/Dropbox/virtual/mailbox/17_10-08-16_20-49-17.json

$new_path=/Users/JamesParsons/Dropbox/virtual/mailbox_archive/17_10-08-16_20-49-17.json

Thanks

Upvotes: 0

Views: 3008

Answers (2)

James Parsons
James Parsons

Reputation: 925

I changed the above from

Storage::move($m, $new_path);

To

File::move($m, $new_path);

Upvotes: 0

Simon Davies
Simon Davies

Reputation: 3684

Your trying to access/move a file on your computer. But you are in a host/vm/server. This will not work as your inside the VM etc and therefore cannot access your dropbox folder.

Upvotes: 0

Related Questions