Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Remove ext mandatory property for saveAs #128

Open
EArminjon opened this issue Oct 9, 2024 · 0 comments
Open

[feature] Remove ext mandatory property for saveAs #128

EArminjon opened this issue Oct 9, 2024 · 0 comments

Comments

@EArminjon
Copy link

EArminjon commented Oct 9, 2024

import 'package:file_saver/file_saver.dart';
import 'package:mime/mime.dart';
import 'package:path/path.dart';

await FileSaver.instance.saveAs(
        filePath: filePath,
        name: basenameWithoutExtension(filePath),
        mimeType: MimeType.custom,
        customMimeType: lookupMimeType(filePath),
        ext: extensionFromMime(
          lookupMimeType(filePath)!,
        ) ?? '',
      ),

If file didn't have any extension, as this lib force us to add one, we got an extra dot at the end of the file. It's a possible scenario to have file without any extension in names.

Foxushka added a commit to Foxushka/file_saver that referenced this issue Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant