【发布时间】:2021-03-29 09:20:25
【问题描述】:
我在 post 请求中向后端发送了一个 excel 文件,并尝试使用以下方法处理该文件:
def __handle_file(file):
destination = open('./data.xslx', 'wb')
for chunk in file.chunks():
destination.write(chunk)
destination.close()
但是,它的输出不是 excel 文件。它是 XML 文件的集合。 我的最终目标是从发送的文件数据中获取数据帧,以便提取数据。
什么是处理此类文件的干净方法?
【问题讨论】:
标签: python django pandas http-post