Skip to content

Commit

Permalink
0.2.5 Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
incrediblezayed committed Jun 26, 2023
1 parent 80609b3 commit 5a5c6e0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file.

## [0.2.5]
* Added apng mime type
* Added custom mimetype \
So basically if you have a custom mimetype and it does not exists in the given enum, you can add your own mimeType using the field \
```dart
String? customMimeType,
```
and you will have to set the mimetype to custom and call the method like
```dart
await FileSaver.instance.saveFile(
name: "FileName",
link: "www.example.com/file.extention",
filePath: "pathOfFile",
file: File(),
bytes: bytes,
ext: "extention",
customMimeType: 'YourCustomType',
mimeType: MimeType.custom);
```

* Fixed repeated extension when using saveAs with MimeType.other on iOS ([GitHub issue #65](https://github.com/incrediblezayed/file_saver/issues/65))

## [0.2.4]
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ await FileSaver.instance.saveFile({
String? filePath,
LinkDetails? link,
String ext = "",
MimeType mimeType = MimeType.other});
MimeType mimeType = MimeType.other,
String? customMimeType
});
```

This saveFile() method has 7 Name arguments.
This saveFile() method has 8 Named arguments.

_String name_ which takes the name of the file,\
_Uint8List bytes_ which will be your actual encoded file,\
Expand Down Expand Up @@ -56,11 +58,15 @@ await FileSaver.instance.saveAs({
String? filePath,
LinkDetails? link,
required String ext,
required MimeType mimeType});
required MimeType mimeType,
String? customMimeType
});
```

All the parameters in this method is same as the saveFile() method.

### Note: customMimeType can only be used when mimeType is set to MimeType.custom

### Storage Permissions & Network Permissions:

> ##### _These Settings are optional for iOS, as in iOS the file will be saved in application documents directory but will not be visible in Files application, to make your file visible in iOS Files application, make the changes mentioned below._
Expand Down

0 comments on commit 5a5c6e0

Please sign in to comment.