get_system_filename#, url, default='file')[source]#

Get filename from given urlopen object and URL.

First, tries the “Content-Disposition”, if unavailable, extracts name from the URL. If this fails, the default keyword will be used.

  • sock (urlopen) – The urlopen to parse for the filename.

  • 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”.


bytes – The filename in file system encoding.