Can't find file downloaded by download manager in android

Viewed 11010

I'm trying to download a file to directory that can vary based on whichever directory the user chooses. I store the current directory in a file object and now attempting to download the file. The file downloads, but it doesn't download the specified directory. So, what can I do to get the file in the directory selected.

// Getting path to store the file   
String path = root.getAbsolutePath();   
path += curr.getName();   
request.setDestinationInExternalPublicDir(path, new File(url).getName());    
// get download service and enqueue file   
DownloadManager manager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);     
manager.enqueue(request);   

The String named url, that is being passed to the File constructor, contains a URL. Just using that to retrieve that name of the file.

UPDATE: I just found the file. Its in the phone not the sd card. It was in this folder, storage\emulated\00. Not sure why? Also, the absolute path that I'm getting is storage\emulated\0.

3 Answers
Related