mirror of
https://github.com/appwrite/appwrite
synced 2026-05-14 04:28:24 +00:00
583 B
583 B
import 'dart:io'; import 'package:appwrite/appwrite.dart';
void main() { // Init SDK Client client = Client(); Storage storage = Storage(client);
client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; Future result = storage.createFile( bucketId: '[BUCKET_ID]', fileId: '[FILE_ID]', file: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'), );
result .then((response) { print(response); }).catchError((error) { print(error.response); }); }