部署在heroku中的django应用程序成功地显示了上传文件表单。然而,一旦我尝试上传Excel文件,它将显示Please check if there were typos in function parameters以下安装安装完成了django-excelpyinstallerpyexcel-xlspyexcel-odshidden
中收到一个错误,显示: excel cannot open the file because the file format or file extension is not valid 嗨,我有一个excel文件我希望用户能够下载Excel文件。def export_daily_report(request): responsebrowser what the file is named
您好,我正在尝试使用DRF将XLSX上传到我的django应用程序。vnd.openxmlformats-officedocument.spreadsheetml.sheet\" in request."
} 我的标头内容类型为"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet".Django有人能告诉我如何处理XLSX文件上传吗?谢谢!
例如,下面的代码首先创建xlsx文件,然后将其作为下载文件流,但我想知道是否有可能在创建xlsx数据时发送它。例如,想象一下,如果需要生成一个非常大的xlsx文件,用户必须等待它完成,然后接收下载,我想要的是在用户浏览器中启动xlsx文件下载,然后在生成数据时发送数据。使用.csv文件似乎很简单,但对于xlsx文件则不是这样。try:
import cStringIO as StringIO