- Home /
Unity Web Player - GAE
I have a problem with hosting my Unity3d web application on GAE. When the application loads and the web player starts to request the ".unity3d" file, i use the following python script to make the HTTP response:
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)
It doesn't work quite well, it finds the file but the Unity web player give me a "bad file length" error.
So can anyone tell me where the problem is ? I think it has something to do with setting the "Content-type", but i don know how to fix it ?
Thanks,
Samer Samy
Answer by Borgo · Sep 12, 2011 at 05:36 PM
Maybe the MIME type is not allowed on the server configuration.
Try to rename the .unity3d file to ".txt" and replace the extension in the HTML too. If it works, then you need to add the ".unity3d" file extension to your "MIME Type" list on the server.
I am using Google App Engine to host the application, so how can i add my $$anonymous$$I$$anonymous$$E type to it ?
You need to contact the support (Google).
I'm from Brazil and my host is "Redehost", they deny this file extension and even I explained about it, they don't unblock this extension, so, I rename all my files to ".txt" and have no problem.
Your answer
![](https://koobas.hobune.stream/wayback/20220612211353im_/https://answers.unity.com/themes/thub/images/avi.jpg)