I receive the image on means of sockets. The image appears in the gallery because the system was informed about the new file by the line:

MediaStore.Images.Media.insertImage(getContentResolver(), file.getAbsolutePath(), file.getName(), file.getName()); 

But it is necessary for me that the user could get access to the file (.txt, .pdf, .doc and other formats) without any file managers. The file should appear in the system download folder, but it does not appear. The experience with the galleries was the same until the line was added. How to inform the system about a new file in order to access it via the download folder? Perhaps there is another way. Thank you in advance and hope for constructive answers.

    1 answer 1

    It is necessary to do the upload through the system service DownloadManager - then it will appear in the downloads folder, otherwise it will not appear there.

    • What about the fact that (1) that the file has already been received and (2) to use DownloadManager, you need Uri (DownloadManager.Request (Uri uri))? Ps file is received not by the server’s address on the network, but by the ip-address of the (local) device of the other one and the transfer port. - Engineman