django - How to download the file from remote source and saving it into local folder using Python -
i need 1 help. need download file remote source , storing local folder using python. explaining code below.
def downloadfile(request): """ function helps download file remote site""" if request.method == 'post': url = request.post.get('file') #i.e-http://koolfeedback.com/beta/about-us.php filename = "status" open(filename,'wb') fyl: fyl.write(urllib2.urlopen(url).read()) fyl.close() here need download page , store local download folder using zip format.please me.
you want use urllib function urlretrieve rather urlopen, opening remote files (such text file on remote server read text from, not files want download).
Comments
Post a Comment