Storage class

The Storage service allows you to manage your project files.

Constructors

Storage.new(Client client)
Initializes a Storage service

Properties

client Client
finalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createFile({required String bucketId, required String fileId, required InputFile file, List<String>? permissions, dynamic onProgress(UploadProgress)?}) Future<File>
Create a new file. Before using this route, you should create a new bucket resource using either a server integration API or directly from your Appwrite console.
deleteFile({required String bucketId, required String fileId}) Future
Delete a file by its unique ID. Only users with write permissions have access to delete this resource.
getFile({required String bucketId, required String fileId}) Future<File>
Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.
getFileDownload({required String bucketId, required String fileId, String? token}) Future<Uint8List>
Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
getFilePreview({required String bucketId, required String fileId, int? width, int? height, ImageGravity? gravity, int? quality, int? borderWidth, String? borderColor, int? borderRadius, double? opacity, int? rotation, String? background, ImageFormat? output, String? token}) Future<Uint8List>
Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.
getFileView({required String bucketId, required String fileId, String? token}) Future<Uint8List>
Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.
listFiles({required String bucketId, List<String>? queries, String? search}) Future<FileList>
Get a list of all the user files. You can use the query params to filter your results.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateFile({required String bucketId, required String fileId, String? name, List<String>? permissions}) Future<File>
Update a file by its unique ID. Only users with write permissions have access to update this resource.

Operators

operator ==(Object other) bool
The equality operator.
inherited