2
我在GAE上託管我的Unity3d Web應用程序時出現問題。 當應用程序負載和網絡播放器開始要求「.unity3d」文件,我用下面的python腳本,使HTTP響應:Unity3d - Google App Engine上的主機
class UnityHandler(webapp.RequestHandler):
def get (self, q):
if q is None:
q = 'WebPlayer.unity3d'
path = os.path.join (os.path.dirname (__file__), q)
self.response.headers ['Content-Type'] = 'text/html'
self.response.out.write (template.render (path, {}))
def main():
application = webapp.WSGIApplication (
[('/(.*html)?', MainHandler),
('/(.*unity3d)?', UnityHandler)
], debug=True)
util.run_wsgi_app (application)
它不工作得非常好,它發現該文件,但Unity網絡播放器給我一個「壞文件長度」的錯誤。
那麼誰能告訴我問題在哪裏? 我認爲它與設置「內容類型」有關,但我不知道如何解決它?
感謝,
薩默爾薩米
謝謝,它的工作,我用這樣的: '處理器: #匹配.unity3d文件 - 網址: /(static/webplayer.unity3d) static_files:static/webplayer.unity3d upload:static/webplayer.unity3d mime_type:application/vnd.unity' –