I want to download the file from the URL such as -
mDownloadUrl = "https://onedrive.live.com/download?cid=xxx";
The problem is that i do not know the filename and content type. It can be pdf, doc, mp3 etc. If i use
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(mDownloadUrl));
setDestinationInExternalPublicDir(dir, filename)
This requires that i know the filename along with the file extension. Also all third party services like onedrive does not support HEAD call (Give 404 error), so i can not get file name from Content-Disposition header.
Is there a way to just specify URL and Directory path and download the file by original name as in content disposition header?