flutter_downloader icon indicating copy to clipboard operation
flutter_downloader copied to clipboard

File not saving in private storage without WRITE_EXTERNAL_STORAGE permission

Open AnkitSuda opened this issue 8 months ago • 0 comments

Describe the bug

The download reaches 100% and stays there indefinitely. I observed that when the download is enqueued, it creates a file in the directory. At 100%, it removes the file and stays stuck at 100% without any error. However, when the WRITE_EXTERNAL_STORAGE permission is granted to the app, the plugin works normally and stores the file. Why WRITE_EXTERNAL_STORAGE permission is required even when saving in private storage?

File is stored in getApplicationDocumentsDirectory().path

To Reproduce

Steps to reproduce the behavior:

  1. Start download in private directory
  2. Download reaches 100% without completion

Expected behavior

Download should be completed and the file should not be deleted.

Screenshots

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Device information:

  • Device: Pixel 6a Emulator
  • OS: Android 9.0 API 28
  • plugin version 1.11.7

Additional context

FlutterDownloader.enqueue(
      url: url,
      savedDir: path.join(((await getApplicationDocumentsDirectory()).path), "offline"),
      requiresStorageNotLow: false,
      fileName: "testfile",
      allowCellular: true,
      saveInPublicStorage: false,
      showNotification: true,
      openFileFromNotification: false,
    )

AnkitSuda avatar Jun 15 '24 14:06 AnkitSuda