File not found at path when trying to copy
Try with File::copy($file, $dest)
instead of Storage::copy($old, $new)
File::copy()
is the wrapper on PHP's copy()
function
You said that the error is like this:
File not found at path: var/www/apk.land/storage/extracted_apks/res/drawable-xxxhdpi-v4/icon.png
Here error is saying it cannot find at var/www
that means it's looking for apk.land/var/www
whereas your file is located somewhere at /var/www
. A quick fix to this can be use file
protocol. Just use it like:
file:///var/www/storage/apk.land/storage/extracted_apks/res/drawable-xxxhdpi-v4/icon.png