Skip to content

Commit 5a5c6e0

Browse files
0.2.5 Updates
1 parent 80609b3 commit 5a5c6e0

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file.
44

55
## [0.2.5]
66
* Added apng mime type
7+
* Added custom mimetype \
8+
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 \
9+
```dart
10+
String? customMimeType,
11+
```
12+
and you will have to set the mimetype to custom and call the method like
13+
```dart
14+
await FileSaver.instance.saveFile(
15+
name: "FileName",
16+
link: "www.example.com/file.extention",
17+
filePath: "pathOfFile",
18+
file: File(),
19+
bytes: bytes,
20+
ext: "extention",
21+
customMimeType: 'YourCustomType',
22+
mimeType: MimeType.custom);
23+
```
24+
725
* Fixed repeated extension when using saveAs with MimeType.other on iOS ([GitHub issue #65](https://github.com/incrediblezayed/file_saver/issues/65))
826

927
## [0.2.4]

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ await FileSaver.instance.saveFile({
2020
String? filePath,
2121
LinkDetails? link,
2222
String ext = "",
23-
MimeType mimeType = MimeType.other});
23+
MimeType mimeType = MimeType.other,
24+
String? customMimeType
25+
});
2426
```
2527

26-
This saveFile() method has 7 Name arguments.
28+
This saveFile() method has 8 Named arguments.
2729

2830
_String name_ which takes the name of the file,\
2931
_Uint8List bytes_ which will be your actual encoded file,\
@@ -56,11 +58,15 @@ await FileSaver.instance.saveAs({
5658
String? filePath,
5759
LinkDetails? link,
5860
required String ext,
59-
required MimeType mimeType});
61+
required MimeType mimeType,
62+
String? customMimeType
63+
});
6064
```
6165

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

68+
### Note: customMimeType can only be used when mimeType is set to MimeType.custom
69+
6470
### Storage Permissions & Network Permissions:
6571

6672
> ##### _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._

0 commit comments

Comments
 (0)