MCPcopy Create free account
hub / github.com/error311/FileRise / getSharedUploadContext

Method getSharedUploadContext

src/FileRise/Domain/FolderModel.php:2718–2729  ·  view source on GitHub ↗
(string $token, ?string $providedPass, string $subPath = '')

Source from the content-addressed store, hash-verified

2716 }
2717
2718 public static function getSharedUploadContext(string $token, ?string $providedPass, string $subPath = ''): array
2719 {
2720 $ctx = self::resolveSharedFolderContext($token, $providedPass, $subPath, false);
2721 if (isset($ctx['error']) || isset($ctx['needs_password'])) {
2722 return $ctx;
2723 }
2724 $record = is_array($ctx['record'] ?? null) ? $ctx['record'] : [];
2725 if (empty($record['allowUpload']) || (int)$record['allowUpload'] !== 1) {
2726 return ['error' => 'File uploads are not allowed for this share.'];
2727 }
2728 return $ctx;
2729 }
2730
2731 /**
2732 * Creates a share link for a folder.

Calls 1

Tested by

no test coverage detected