Skip to content

File not saving in private storage without WRITE_EXTERNAL_STORAGE permission #962

Open
@AnkitSuda

Description

@AnkitSuda

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,
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions