I'm trying to unzip the file from an URL, and stuck with the below Error. I would get the URL's dynamic so the path may keep vary.
[Errno 22] invalid mode ('rb') or filename: 'http://example.com/media/example.zip'
url = r"http://" + request.get_host() + uploaded_file_url
with zipfile.ZipFile(url, "r") as zip_ref:
zip_ref.extractall("c:/tmp")
zip_ref.namelist()
The above is the piece of code that i use for unzip. As per my understanding expected is to pass the escape character so that it can read url "IOError: [Errno 22] invalid mode ('r') or filename: 'c:\\Python27\test.txt'"
How we can do this for URL.