1
0
Fork 0
mirror of synced 2024-05-19 04:02:34 +12:00
appwrite/docs/examples/0.10.x/client-flutter/examples/storage/create-file.md
Torsten Dittmann bcd866ea1d add docs
2021-09-02 12:00:05 +02:00

540 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( file: await MultipartFile.fromPath('file', './path-to-files/image.jpg', 'image.jpg'), );

result .then((response) { print(response); }).catchError((error) { print(error.response); }); }