我正在使用filename.aspx
课程从网站下载webview中的pdf,但pdf正在下载为.aspx
。如何将其转换为.pdf
到filename.pdf
。我只想将文件保存为filename.aspx
而不是DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
request.setTitle("");
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
String nameOfFile = URLUtil.guessFileName(url, null, MimeTypeMap.getFileExtensionFromUrl(url));
File f = new File(Environment.getExternalStorageDirectory() + "/" + mainFolder + "/" + timeTableFolder);
if (!f.exists()) {
f.mkdirs();
}
request.setDestinationInExternalPublicDir(mainFolder + "/" + timeTableFolder, nameOfFile);
DownloadManager downloadManager = (DownloadManager) getApplicationContext().getSystemService(Context.DOWNLOAD_SERVICE);
downloadManager.enqueue(request);
以下是代码
ReadOnlyCollection<T>