incrediblezayed / file_saver

A simple flutter plugin for saving files in all platforms
https://pub.dev/packages/file_saver
BSD 3-Clause "New" or "Revised" License
75 stars 101 forks source link

`saveAs` allows only for saving in Downloads directory #95

Closed RobertOdrowaz closed 7 months ago

RobertOdrowaz commented 8 months ago

When saveAs method is called the file picker on android doesn't allow changing location from initial Downloads directory to anywhere else.

Screenshot emulator API 34 ![Screenshot_1705147961](https://github.com/incrediblezayed/file_saver/assets/9675199/c937ee1d-a1ab-4f17-b0ab-8300b138f9cf)

This seems to be causes by intent.putExtra(Intent.EXTRA_MIME_TYPES, type) for some reason and removing it resolves the issue. It's not the only intent parameter that seems unnecessary:

FLAG_GRANT_WRITE_URI_PERMISSION sounds necessary but everything seems to work fine without it so I'm not sure about it

incrediblezayed commented 7 months ago

Those parameters were exactly added to fix that issue specifically, I think we need to study this a bit more, @RobertOdrowaz

incrediblezayed commented 7 months ago

I was able to reproduce this, merging your fix