createFile method

Future<Response> createFile({
  1. required MultipartFile file,
  2. List? read,
  3. List? write,
})

Create File

Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.

Implementation

Future<req.Response> createFile(
    {required dio.MultipartFile file, List? read, List? write}) {
  final String path = '/storage/files';

  final Map<String, dynamic> params = {
    'file': file,
    'read': read,
    'write': write,
  };

  final Map<String, String> headers = {
    'content-type': 'multipart/form-data',
  };

  return client.call(HttpMethod.post,
      path: path, params: params, headers: headers);
}