Git Product home page Git Product logo

Comments (2)

yrezgui avatar yrezgui commented on May 2, 2024 1

Let me give a try to reproduce the issue. I might escalate the problem with the Android storage engineers if it's not related to ModernStorage

from modernstorage.

yrezgui avatar yrezgui commented on May 2, 2024

So I investigated a bit but wasn't able to reproduce the same issue you're getting (at least on an emulator).

Two things to note though, your getExternalStorageDir is pointing to two different folders. The first one is the app's own Download external folder (which isn't visible by other apps since Android 11, was never supposed to be public to be honest) and the second one is the shared Download folder (visible with a file manager):

# applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)
/storage/emulated/0/Android/data/com.google.modernstorage.storage.test/files/Download

# Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
/storage/emulated/0/Download

On Android 11 (I haven't tried yet on previous versions), it doesn't let me write to the app's own Download external folder. It doesn't trigger an exception but change the target folder by putting it in the device shared Download folder.
I've tried setting the same file name but end up having MediaStore adding a suffix automatically:

# First try
uri = content://media/external/file/65
path = /storage/emulated/0/Download/samefile.pdf

# Second try
uri = content://media/external/file/66
path = /storage/emulated/0/Download/samefile (1).pdf

Could you share me a snippet adding the same file twice from your project just to make sure I'm reproducing it in the same way? Thanks!

from modernstorage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.