Want to prompt browser to save csv

后端 未结 3 864
终归单人心
终归单人心 2021-02-10 10:04

Want to prompt browser to save csv using pyramid.response.Response searched for clues and found here\'s a link Django answer but i can\'t use it with Pyramid wsgi my code looks

3条回答
  •  野性不改
    2021-02-10 10:30

    It's better to set content type as well

    response['Content-type'] = 'text/csv'
    response['Content-Disposition'] = 'attachment; filename="report.csv"'
    

提交回复
热议问题