Move directory from one location to another in SFTP storage laravel 9
Hello Team, I'm uploading my files to a remote server via sftp storage, the storage location is var/multilabel/batch_1/input ,var/multilabel/batch_2/input ,var/multilabel/batch_3/input and so on... On the remote server, the script is integrated which generates a result.csv file in the output folder which is based on the images uploaded at a particular path inside the input folder because uploading takes time, the script of generated result.csv gets executed before the uploading process gets complete. So I have an idea that I will upload to some other location on a remote server via sftp example /var/multilable_tmp/batch_1/input ,/var/multilable_tmp/batch_2/input and then will move the whole directory at once to the desired location.
I tried to move using the following code but to move the directory I need the full path to the SFTP disk. use Illuminate\Filesystem\Filesystem; $file = new Filesystem(); $moved = $file->moveDirectory($from, $to);
to get the full path to sftp disk I used the following code but it throws an error of undefined method
Storage::disk('sftp')->getDriver()->getAdapter()->getPathPrefix('var/mutiilabel/batch_1') Can anybody help me with this
Please or to participate in this conversation.