appwrite/docs/examples/1.7.x/client-flutter/examples/storage/create-file.md
2025-05-18 02:25:38 +12:00

480 B

import 'dart:io'; import 'package:appwrite/appwrite.dart';

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

Storage storage = Storage(client);

File result = await storage.createFile( bucketId: '<BUCKET_ID>', fileId: '<FILE_ID>', file: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'), permissions: ["read("any")"], // optional );