Crazylife's avatar

How to zip each folder in a directories and upload it to somewhere?

I have a folder in public directories. The folder name as records. Inside the 'records' folder consist of two folder name as 'buyer_records' and 'seller_records'.

I am using this function to store the relevant file into these two folder.

 Storage::disk('uploads')->put('/buyer_records/'.$file, $contents);
 Storage::disk('uploads')->put('/seller_records/'.$file, $contents);

I want to zip each of the folder inside 'records' folder. For example,

buyer_records_180325.zip
seller_records_180325.zip

The naming of folder will follow by the original naming of folder just append the date on it.

After that i will use SFTP to upload the zip file to somewhere else.

How can i do this?

0 likes
0 replies

Please or to participate in this conversation.