Django 下载文件报错解决
实现方法参考自网页http://www.jianshu.com/p/2ce715671340,在Django中实现网页下载文件时,会报错:UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xb1 in position 5: illegal multibyte sequence
解决方法: 将
with open(_file_name) as f:
改为
with open(_file_name, "rb") as f: