getFileView method

Future<Response> getFileView({
  1. required String fileId,
})

Get File for View

Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.

Implementation

Future<req.Response> getFileView({required String fileId}) {
  final String path =
      '/storage/files/{fileId}/view'.replaceAll(RegExp('{fileId}'), fileId);

  final Map<String, dynamic> params = {
    'project': client.config['project'],
  };

  params.keys.forEach((key) {
    if (params[key] is int || params[key] is double) {
      params[key] = params[key].toString();
    }
  });

  return client.call(HttpMethod.get,
      path: path, params: params, responseType: dio.ResponseType.bytes);
}