-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