mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
19 lines
333 B
Markdown
19 lines
333 B
Markdown
# Creating documents
|
|
|
|
Create by relative path:
|
|
|
|
```php
|
|
$dms = DMS::getDMSInstance();
|
|
$doc = $dms->storeDocument('assets/myfile.pdf');
|
|
```
|
|
|
|
Create from an existing `File` record:
|
|
|
|
```php
|
|
$dms = DMS::getDMSInstance();
|
|
$file = File::get()->byID(99);
|
|
$doc = $dms->storeDocument($file);
|
|
```
|
|
|
|
Note: Both operations copy the existing file.
|