def handle_uploaded_file(filecnt, typ):
 md5 = hashlib.md5()
 for chunk in filecnt.chunks():
  md5.update(chunk)
 md5sum = md5.hexdigest()
 anal_dir = os.path.join(settings.UPLD_DIR, (md5sum + '/'))
 if (not os.path.exists(anal_dir)):
  os.makedirs(anal_dir)
 with open(((anal_dir + md5sum) + typ), 'wb+') as destination:
  for chunk in filecnt.chunks():
   destination.write(chunk)
 return md5sum

def handle_uploaded_file ( filecnt , typ ) : md5 = hashlib . md5 ( ) for chunk in filecnt . chunks ( ) : md5 . update ( chunk ) md5sum = md5 . hexdigest ( ) anal_dir = os . path . join ( settings . UPLD_DIR , ( md5sum + '/' ) ) if ( not os . path . exists ( anal_dir ) ) : os . makedirs ( anal_dir ) with open ( ( ( anal_dir + md5sum ) + typ ) , 'wb+' ) as destination : for chunk in filecnt . chunks ( ) : destination . write ( chunk ) return md5sum
write uploaded file .