react-native-appwrite 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/sdk.js CHANGED
@@ -2287,7 +2287,12 @@ class Storage extends Service {
2287
2287
  position: offset,
2288
2288
  length: Service.CHUNK_SIZE
2289
2289
  });
2290
- payload['file'] = { uri: `data:${file.type};base64,${chunk}`, name: file.name, type: file.type };
2290
+ var path = `data:${file.type};base64,${chunk}`;
2291
+ if (Device.osName == 'Android') {
2292
+ path = FileSystem.cacheDirectory + '/tmp_chunk';
2293
+ yield FileSystem.writeAsStringAsync(path, chunk, { encoding: FileSystem.EncodingType.Base64 });
2294
+ }
2295
+ payload['file'] = { uri: path, name: file.name, type: file.type };
2291
2296
  response = yield this.client.call('post', uri, apiHeaders, payload);
2292
2297
  if (onProgress) {
2293
2298
  onProgress({