diff --git a/lib/Sabre/Album/AlbumRoot.php b/lib/Sabre/Album/AlbumRoot.php
index eb2bda180..12dbc5e91 100644
--- a/lib/Sabre/Album/AlbumRoot.php
+++ b/lib/Sabre/Album/AlbumRoot.php
@@ -14,6 +14,7 @@
use OCA\Photos\Album\AlbumWithFiles;
use OCA\Photos\Service\UserConfigService;
use OCP\Files\Folder;
+use OCP\Files\InvalidDirectoryException;
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use Sabre\DAV\Exception\Conflict;
@@ -81,6 +82,11 @@ public function createFile($name, $data = null) {
throw new Conflict('The destination exists and is not a folder');
}
+ if ($photosFolder->isShared()) {
+ throw new Conflict('The destination exists and is not a folder');
+ throw new InvalidDirectoryException('The destination is a received share');
+ }
+
// Check for conflict and rename the file accordingly
$newName = $photosFolder->getNonExistingName($name);
diff --git a/src/components/PhotosPicker.vue b/src/components/PhotosPicker.vue
index bb9ece02e..6c37c819b 100644
--- a/src/components/PhotosPicker.vue
+++ b/src/components/PhotosPicker.vue
@@ -43,18 +43,25 @@
-
-
-
-
-
-
- {{ t('photos', 'Add to {destination}', { destination }) }}
-
+