feat: update default content

Signed-off-by: Luka Trovic <luka@nextcloud.com>
This commit is contained in:
Luka Trovic
2025-02-13 10:43:55 +01:00
parent 6dd623f796
commit b15254f1ed
9 changed files with 235 additions and 38 deletions

View File

@@ -162,7 +162,15 @@ class FilesAppService implements IAttachmentService, ICustomAttachmentService {
}
public function create(Attachment $attachment) {
$file = $this->getUploadedFile();
if ($attachment->getData() === 'DEFAULT_SAMPLE_FILE' && !$this->request->getUploadedFile('file')) {
$file = [
'name' => 'Nextcloud sample image - add your image here!.jpg',
'tmp_name' => __DIR__ . '/../../img/sample-image.jpg',
];
} else {
$file = $this->getUploadedFile();
}
$fileName = $file['name'];
// get shares for current card