Skip to content

如何设置下载到自定义目录 #101

Open

Description

@mylyd

感谢作者
现有有一个问题,我想下载文件到自定义的目录,但是我看代码发现,我在调用DownloadManager.add()的时候,会默认将DownloadRequest中的rootDownloadDir目录设置为 context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS),
然后我也看了DownloadManager,没有暴露DownloadRequestQueue的add方法, 也没有办法手动去add一个任务,有没有什么办法能自定义一个路径呢

Activity

  1. coolerfall commented on Feb 21, 2024

    @coolerfall
    Owner

    由于SAF限制, 其他目录需要权限, 可以在下载完后移动即可

  2. dhs964057117 commented on Oct 11, 2025

    @dhs964057117

    感谢作者 现有有一个问题,我想下载文件到自定义的目录,但是我看代码发现,我在调用DownloadManager.add()的时候,会默认将DownloadRequest中的rootDownloadDir目录设置为 context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), 然后我也看了DownloadManager,没有暴露DownloadRequestQueue的add方法, 也没有办法手动去add一个任务,有没有什么办法能自定义一个路径呢

    This repository seems to be out of maintenance. I have a repository that is being maintained. Maybe you can try it?https://github.com/dhs964057117/Titan-Downloader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions