Learn how to use Nhost Storage
files
table in the storage
schema. This means that file metadata is available in your GraphQL API, which makes it easy to:
storage
schema.storage.files
table and a file id
is returned. The file’s id
is how you reference and access the file. It’s recommended to create your own table to store the uploaded file id
, to access the file in the future.
upload()
.public
role to set select permissions.
getPublicUrl()
.default
bucket, the expiration time is 30 seconds. You can change the expiration time for pre-signed URLs by changing the download_expiration
(in seconds) field for the bucket where the file is located.
getPresignedUrl()
.delete()
.storage.buckets
table in your database, and accessible via buckets
in your GraphQL API.
For each Bucket, you can specify file permissions for the following properties:
default
) that is used if no Bucket is specified during file upload. It’s not possible to delete the default
Bucket.
storage.files
table.
insert
permission to the storage.files
table. The id
column must be granted.
The following columns can be used for insert permissions:
id
bucket_id
name
size
mime_type
select
permission to the storage.files
table. All columns must be granted.
delete
permission to the storage.files
table.
Updating an existing file is not supported. If you need to update a file, delete the file and upload a new file.
Just deleting the file metadata in the storage.files
table does not delete the actual file. Always delete files via Nhost Storage. This way, both the file metadata and the actual file are deleted.
w
- Width of the image in pixels.h
- Height of the image in pixels.?w=500
):