# copy\_folder\_recursive()

## Copy a folder recursively

&#x20; <mark style="background-color:orange;">copy\_folder\_recursive()</mark> &#x20;

This method will copy the contents of an folder into another folder.

{% tabs %}
{% tab title="OneDrive" %}
{% hint style="info" %}
**Not supported. Use** [**copy()**](https://wpcloudplugins.gitbook.io/docs/developers/api/copy) **instead.**
{% endhint %}
{% endtab %}

{% tab title="Google Drive" %}

### **Parameters**

<table><thead><tr><th width="184">Name</th><th width="88">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>$folder_id</code></td><td>string</td><td>ID of the folder containing the files that should be copied.</td></tr><tr><td><code>$target_id</code></td><td>string</td><td>ID of the folder where the files should be copied to.</td></tr></tbody></table>

### **Return**

<table><thead><tr><th width="184">Name</th><th width="167">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>$result</code></td><td>bool</td><td>The result of the copy operation.</td></tr></tbody></table>

### **Usage**

```php
WPCP_GDRIVE_API::set_account_by_id('201096615285735764133')

$result = WPCP_GDRIVE_API::copy_folder_recursive('1FCYkOJb150I8nl8DE92YIXWaB0J7VOk5', '1eedpdrZPBHpPKblQwa3khFcka1A2l0oL');
```

{% endtab %}

{% tab title="Dropbox" %}
{% hint style="info" %}
**Not supported. Use** [**copy()**](https://wpcloudplugins.gitbook.io/docs/developers/api/copy) **instead.**
{% endhint %}
{% endtab %}

{% tab title="Box" %}
{% hint style="info" %}
**Not supported. Use** [**copy()**](https://wpcloudplugins.gitbook.io/docs/developers/api/copy) **instead.**
{% endhint %}
{% endtab %}
{% endtabs %}
