Skip to content

Commit 09e557e

Browse files
committed
feat: custom file size limit and mime types at bucket level
1 parent 4c37c14 commit 09e557e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

addons/supabase/Storage/storage.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ func get_bucket(id : String) -> StorageTask:
5050
return task
5151

5252

53-
func create_bucket(_name : String, id : String, public : bool = false) -> StorageTask:
53+
func create_bucket(_name : String, id : String, options: Dictionary = { public = false, file_size_limit = "100mb", allowed_mime_types = ["*/*"] }) -> StorageTask:
5454
var endpoint : String = _config.supabaseUrl + _rest_endpoint + "bucket"
5555
var task : StorageTask = StorageTask.new()
5656
task._setup(
5757
task.METHODS.CREATE_BUCKET,
5858
endpoint,
5959
_header + get_parent().auth.__get_session_header(),
60-
JSON.stringify({name = _name, id = id, public = public}))
60+
JSON.stringify({name = _name, id = id, public = options.get("public", false), file_size_limit = options.get("file_size_limit", "100mb"), allowed_mime_types = options.get("allowed_mime_types", ["*/*"]) }))
6161
_process_task(task)
6262
return task
6363

0 commit comments

Comments
 (0)