download_fileobj#
- sunpy.util.net.download_fileobj(opn, directory, url='', default='file', overwrite=False)[source]#
Deprecated since version 7.0: The download_fileobj function is deprecated and may be removed in a future version. Use parfive.Downloader.simple_download instead.
Download a file from a url into a directory.
Tries the “Content-Disposition”, if unavailable, extracts name from the URL. If this fails, the
defaultkeyword will be used.- Parameters:
directory (
str) – The directory path to download the file in to.url (
str) – The URL to parse for the filename.default (
str, optional) – The name to use if the first two methods fail. Defaults to “file”.overwrite (
bool, optional) – IfTruewill overwrite a file of the same name. Defaults toFalse.
- Returns:
str– The file path for the downloaded file.