-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathupdateFile.cpp
More file actions
24 lines (20 loc) · 757 Bytes
/
updateFile.cpp
File metadata and controls
24 lines (20 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "Appwrite.hpp"
#include <iostream>
int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";
std::string bucketId = "bucketnew";
std::string fileId = "68065a960022c73ad785";
std::string name = "pingu123updated";
Appwrite appwrite(projectId, apiKey);
std::vector<std::string> permissions = {"read(\"any\")", "write(\"any\")"};
try {
std::string response = appwrite.getStorage().updateFile(
bucketId, fileId, name, permissions);
std::cout << "Bucket updated successfully! \nResponse: " << response
<< std::endl;
} catch (const AppwriteException &ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
}
return 0;
}