python to tell file extension in base64 code example
Example 1: javascript find file extension from string
var ext = fileName.split('.').pop();
Example 2: how to download file in python
import urllib2
filedata = urllib2.urlopen('http://i3.ytimg.com/vi/J---aiyznGQ/mqdefault.jpg')
datatowrite = filedata.read()
with open('/Users/scott/Downloads/cat2.jpg', 'wb') as f:
f.write(datatowrite)