Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 767 Bytes

File metadata and controls

27 lines (22 loc) · 767 Bytes

import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.Permission; import io.appwrite.Role; import io.appwrite.services.Storage;

Client client = new Client(context) .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("<YOUR_PROJECT_ID>"); // Your project ID

Storage storage = new Storage(client);

storage.updateFile( "<BUCKET_ID>", // bucketId "<FILE_ID>", // fileId "", // name (optional) List.of(Permission.read(Role.any())), // permissions (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; }

    Log.d("Appwrite", result.toString());
})

);