docs: push new changes
This commit is contained in:
parent
248df3b13d
commit
a07facb66c
|
@ -21,7 +21,7 @@ public class MainActivity extends AppCompatActivity {
|
|||
storage.createFile(
|
||||
"[BUCKET_ID]",
|
||||
"[FILE_ID]",
|
||||
File("./path-to-files/image.jpg"),
|
||||
File("file.png"),
|
||||
new Continuation<Object>() {
|
||||
@NotNull
|
||||
@Override
|
||||
|
|
|
@ -20,7 +20,7 @@ class MainActivity : AppCompatActivity() {
|
|||
val response = storage.createFile(
|
||||
bucketId = "[BUCKET_ID]",
|
||||
fileId = "[FILE_ID]",
|
||||
file = File("./path-to-files/image.jpg"),
|
||||
file = File("file.png"),
|
||||
)
|
||||
val json = response.body?.string()
|
||||
}
|
||||
|
|
|
@ -8,9 +8,18 @@ void main() { // Init SDK
|
|||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
// downloading file
|
||||
Future result = avatars.getBrowser(
|
||||
code: 'aa',
|
||||
).then((bytes) {
|
||||
final file = File('path_to_file/filename.ext');
|
||||
file.writeAsBytesSync(bytes)
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
})
|
||||
}
|
||||
|
||||
//displaying image
|
||||
//displaying image preview
|
||||
FutureBuilder(
|
||||
future: avatars.getBrowser(
|
||||
code: 'aa',
|
||||
|
|
|
@ -8,9 +8,18 @@ void main() { // Init SDK
|
|||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
// downloading file
|
||||
Future result = avatars.getCreditCard(
|
||||
code: 'amex',
|
||||
).then((bytes) {
|
||||
final file = File('path_to_file/filename.ext');
|
||||
file.writeAsBytesSync(bytes)
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
})
|
||||
}
|
||||
|
||||
//displaying image
|
||||
//displaying image preview
|
||||
FutureBuilder(
|
||||
future: avatars.getCreditCard(
|
||||
code: 'amex',
|
||||
|
|
|
@ -8,9 +8,18 @@ void main() { // Init SDK
|
|||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
// downloading file
|
||||
Future result = avatars.getFavicon(
|
||||
url: 'https://example.com',
|
||||
).then((bytes) {
|
||||
final file = File('path_to_file/filename.ext');
|
||||
file.writeAsBytesSync(bytes)
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
})
|
||||
}
|
||||
|
||||
//displaying image
|
||||
//displaying image preview
|
||||
FutureBuilder(
|
||||
future: avatars.getFavicon(
|
||||
url: 'https://example.com',
|
||||
|
|
|
@ -8,9 +8,18 @@ void main() { // Init SDK
|
|||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
// downloading file
|
||||
Future result = avatars.getFlag(
|
||||
code: 'af',
|
||||
).then((bytes) {
|
||||
final file = File('path_to_file/filename.ext');
|
||||
file.writeAsBytesSync(bytes)
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
})
|
||||
}
|
||||
|
||||
//displaying image
|
||||
//displaying image preview
|
||||
FutureBuilder(
|
||||
future: avatars.getFlag(
|
||||
code: 'af',
|
||||
|
|
|
@ -8,9 +8,18 @@ void main() { // Init SDK
|
|||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
// downloading file
|
||||
Future result = avatars.getImage(
|
||||
url: 'https://example.com',
|
||||
).then((bytes) {
|
||||
final file = File('path_to_file/filename.ext');
|
||||
file.writeAsBytesSync(bytes)
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
})
|
||||
}
|
||||
|
||||
//displaying image
|
||||
//displaying image preview
|
||||
FutureBuilder(
|
||||
future: avatars.getImage(
|
||||
url: 'https://example.com',
|
||||
|
|
|
@ -8,9 +8,17 @@ void main() { // Init SDK
|
|||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
// downloading file
|
||||
Future result = avatars.getInitials(
|
||||
).then((bytes) {
|
||||
final file = File('path_to_file/filename.ext');
|
||||
file.writeAsBytesSync(bytes)
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
})
|
||||
}
|
||||
|
||||
//displaying image
|
||||
//displaying image preview
|
||||
FutureBuilder(
|
||||
future: avatars.getInitials(
|
||||
), //works for both public file and private file, for private files you need to be logged in
|
||||
|
|
|
@ -8,9 +8,18 @@ void main() { // Init SDK
|
|||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
// downloading file
|
||||
Future result = avatars.getQR(
|
||||
text: '[TEXT]',
|
||||
).then((bytes) {
|
||||
final file = File('path_to_file/filename.ext');
|
||||
file.writeAsBytesSync(bytes)
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
})
|
||||
}
|
||||
|
||||
//displaying image
|
||||
//displaying image preview
|
||||
FutureBuilder(
|
||||
future: avatars.getQR(
|
||||
text: '[TEXT]',
|
||||
|
|
|
@ -8,9 +8,19 @@ void main() { // Init SDK
|
|||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
// downloading file
|
||||
Future result = storage.getFileDownload(
|
||||
bucketId: '[BUCKET_ID]',
|
||||
fileId: '[FILE_ID]',
|
||||
).then((bytes) {
|
||||
final file = File('path_to_file/filename.ext');
|
||||
file.writeAsBytesSync(bytes)
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
})
|
||||
}
|
||||
|
||||
//displaying image
|
||||
//displaying image preview
|
||||
FutureBuilder(
|
||||
future: storage.getFileDownload(
|
||||
bucketId: '[BUCKET_ID]',
|
||||
|
|
|
@ -8,9 +8,19 @@ void main() { // Init SDK
|
|||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
// downloading file
|
||||
Future result = storage.getFilePreview(
|
||||
bucketId: '[BUCKET_ID]',
|
||||
fileId: '[FILE_ID]',
|
||||
).then((bytes) {
|
||||
final file = File('path_to_file/filename.ext');
|
||||
file.writeAsBytesSync(bytes)
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
})
|
||||
}
|
||||
|
||||
//displaying image
|
||||
//displaying image preview
|
||||
FutureBuilder(
|
||||
future: storage.getFilePreview(
|
||||
bucketId: '[BUCKET_ID]',
|
||||
|
|
|
@ -8,9 +8,19 @@ void main() { // Init SDK
|
|||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
// downloading file
|
||||
Future result = storage.getFileView(
|
||||
bucketId: '[BUCKET_ID]',
|
||||
fileId: '[FILE_ID]',
|
||||
).then((bytes) {
|
||||
final file = File('path_to_file/filename.ext');
|
||||
file.writeAsBytesSync(bytes)
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
})
|
||||
}
|
||||
|
||||
//displaying image
|
||||
//displaying image preview
|
||||
FutureBuilder(
|
||||
future: storage.getFileView(
|
||||
bucketId: '[BUCKET_ID]',
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
const sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
let promise = sdk.account.delete();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -1,14 +0,0 @@
|
|||
const sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
let promise = sdk.account.delete();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -12,7 +12,7 @@ client
|
|||
;
|
||||
|
||||
|
||||
let promise = functions.createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', new File([fileBlob], 'file.png'), false);
|
||||
let promise = functions.createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', 'file.png', false);
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
|
|
|
@ -12,7 +12,7 @@ client
|
|||
;
|
||||
|
||||
|
||||
let promise = storage.createFile('[BUCKET_ID]', '[FILE_ID]', new File([fileBlob], 'file.png'));
|
||||
let promise = storage.createFile('[BUCKET_ID]', '[FILE_ID]', 'file.png');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
|
|
|
@ -11,7 +11,7 @@ public void main() {
|
|||
functions.createDeployment(
|
||||
functionId = "[FUNCTION_ID]",
|
||||
entrypoint = "[ENTRYPOINT]",
|
||||
code = File("./path-to-files/image.jpg"),
|
||||
code = File("file.png"),
|
||||
activate = false
|
||||
new Continuation<Response>() {
|
||||
@NotNull
|
||||
|
|
|
@ -11,7 +11,7 @@ public void main() {
|
|||
storage.createFile(
|
||||
bucketId = "[BUCKET_ID]",
|
||||
fileId = "[FILE_ID]",
|
||||
file = File("./path-to-files/image.jpg"),
|
||||
file = File("file.png"),
|
||||
new Continuation<Response>() {
|
||||
@NotNull
|
||||
@Override
|
||||
|
|
|
@ -11,7 +11,7 @@ suspend fun main() {
|
|||
val response = functions.createDeployment(
|
||||
functionId = "[FUNCTION_ID]",
|
||||
entrypoint = "[ENTRYPOINT]",
|
||||
code = File("./path-to-files/image.jpg"),
|
||||
code = File("file.png"),
|
||||
activate = false
|
||||
)
|
||||
val json = response.body?.string()
|
||||
|
|
|
@ -11,7 +11,7 @@ suspend fun main() {
|
|||
val response = storage.createFile(
|
||||
bucketId = "[BUCKET_ID]",
|
||||
fileId = "[FILE_ID]",
|
||||
file = File("./path-to-files/image.jpg"),
|
||||
file = File("file.png"),
|
||||
)
|
||||
val json = response.body?.string()
|
||||
}
|
|
@ -12,7 +12,7 @@ client
|
|||
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
||||
;
|
||||
|
||||
let promise = functions.createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', fs.createReadStream(__dirname + '/file.png'), false);
|
||||
let promise = functions.createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', 'file.png', false);
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
|
|
|
@ -12,7 +12,7 @@ client
|
|||
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
||||
;
|
||||
|
||||
let promise = storage.createFile('[BUCKET_ID]', '[FILE_ID]', fs.createReadStream(__dirname + '/file.png'));
|
||||
let promise = storage.createFile('[BUCKET_ID]', '[FILE_ID]', 'file.png');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
|
|
|
@ -13,4 +13,4 @@ $client
|
|||
|
||||
$functions = new Functions($client);
|
||||
|
||||
$result = $functions->createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', new \CURLFile('/path/to/file.png', 'image/png', 'file.png'), false);
|
||||
$result = $functions->createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', 'file.png', false);
|
|
@ -13,4 +13,4 @@ $client
|
|||
|
||||
$storage = new Storage($client);
|
||||
|
||||
$result = $storage->createFile('[BUCKET_ID]', '[FILE_ID]', new \CURLFile('/path/to/file.png', 'image/png', 'file.png'));
|
||||
$result = $storage->createFile('[BUCKET_ID]', '[FILE_ID]', 'file.png');
|
|
@ -11,4 +11,4 @@ client = Client()
|
|||
|
||||
functions = Functions(client)
|
||||
|
||||
result = functions.create_deployment('[FUNCTION_ID]', '[ENTRYPOINT]', open('/path/to/file.png', 'rb'), False)
|
||||
result = functions.create_deployment('[FUNCTION_ID]', '[ENTRYPOINT]', 'file.png', False)
|
||||
|
|
|
@ -11,4 +11,4 @@ client = Client()
|
|||
|
||||
storage = Storage(client)
|
||||
|
||||
result = storage.create_file('[BUCKET_ID]', '[FILE_ID]', open('/path/to/file.png', 'rb'))
|
||||
result = storage.create_file('[BUCKET_ID]', '[FILE_ID]', 'file.png')
|
||||
|
|
|
@ -9,6 +9,6 @@ client
|
|||
|
||||
functions = Appwrite::Functions.new(client)
|
||||
|
||||
response = functions.create_deployment(function_id: '[FUNCTION_ID]', entrypoint: '[ENTRYPOINT]', code: File.new(), activate: false)
|
||||
response = functions.create_deployment(function_id: '[FUNCTION_ID]', entrypoint: '[ENTRYPOINT]', code: 'dir/file.png', activate: false)
|
||||
|
||||
puts response.inspect
|
|
@ -9,6 +9,6 @@ client
|
|||
|
||||
storage = Appwrite::Storage.new(client)
|
||||
|
||||
response = storage.create_file(bucket_id: '[BUCKET_ID]', file_id: '[FILE_ID]', file: File.new())
|
||||
response = storage.create_file(bucket_id: '[BUCKET_ID]', file_id: '[FILE_ID]', file: 'dir/file.png')
|
||||
|
||||
puts response.inspect
|
Loading…
Reference in a new issue