@spacehq/sdk > UserStorage > setFilePublicAccess
UserStorage.setFilePublicAccess() method
Allow or revoke public access to a file.
Signature:
setFilePublicAccess(request: MakeFilePublicRequest): Promise<void>;
Parameters
Parameter | Type | Description |
---|---|---|
request | MakeFilePublicRequest |
Returns:
Promise<void>
Example
const spaceStorage = new UserStorage(spaceUser);
await spaceStorage.setFilePublicAccess({
bucket: 'personal',
path: '/file.txt',
allowAccess: true, // <- set to false to revoke public access
});