Back

how to enable bucket at the time of creating using server sdk

  • 0
  • Storage
  • Cloud
animeyeet
11 Jun, 2023, 10:06
TL;DR
The user is asking how to enable a bucket at the time of creation using the server SDK. They mention trying a code on the cloud and it worked. They provide code and versions of Appwrite and the SDK they are using. They asked if the SDK version is mentioned in requirements.txt and if they are on Appwrite cloud. They also mentioned that the bucket should be enabled by default and questioned what happens if they leave out the parameter. Solution: Use the provided code to create the bucket and ensure that the SDK version is compatible and mentioned in requirements.txt. Check if the user is on Appwrite cloud and try leaving out the 'enabled
Drake
11 Jun, 2023, 17:45

What version of the python SDK are you using?

Drake
11 Jun, 2023, 17:46

Also it should be enabled by default...what happens if you leave out the parameter?

Drake
11 Jun, 2023, 17:46

Are you on Appwrite cloud?

animeyeet
12 Jun, 2023, 03:42

Yes

animeyeet
12 Jun, 2023, 04:07

idk about the sdk version but

Drake
12 Jun, 2023, 04:09

Is the version mentioned in your requirements.txt or build logs?

animeyeet
12 Jun, 2023, 04:10

Downloading appwrite-2.0.0.tar.gz (15 kB)

animeyeet
12 Jun, 2023, 04:10

in requirements.txt it's not mention

Drake
13 Jun, 2023, 00:13

okay so on Appwrite 1.3 and the SDK version 2.0.0, I had to run:

TypeScript
    response = storage.create_bucket(
        bucket_id=ID.unique(),
        name="awesome bucket",
        file_security=True,
        permissions=[
            Permission.read(Role.any()),
            Permission.create(Role.users()),
            Permission.update(Role.users()),
            Permission.delete(Role.users()),
        ],
        enabled=True,
        maximum_file_size=1000000,
        allowed_file_extensions=[],
        compression="none",
        encryption=False,
        antivirus=False,
    )

To create the bucket:

Drake
13 Jun, 2023, 00:14

oh wait..you're on cloud..

Drake
13 Jun, 2023, 16:47

@animeyeet ok i tried the same code on cloud and it worked as exected πŸ‘€

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more