-2
我知道有这个几个线程,但我不能找到我做错了。 这是示数的代码:如何在python中强制下载xml?
print 'Content-Type: text/xml \n'
print 'Content-Disposition:attachment;filename="test.qwc" \n'
print 'Content-Length:' + len(xml)
print xml
XML变量是简单XML字符串。 XML很好,因为我可以将它打印到浏览器中。但是当我添加Content-Disposition和Content-Length行时,它给了我这个错误:
XML Parsing Error: not well-formed
Location: http:/myurl/XMLqwc.py?franchiseid=1
Line Number 1, Column 31:
Content-Disposition:attachment;filename="test.qwc"
------------------------------^
任何想法? 在此先感谢您的帮助!
什么是“它”那是给你一个错误? – drysdam 2011-04-05 17:02:10
与标题或标签中的问题相关的唯一单词是“python”。 – 2011-04-05 17:46:38