x


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

more ▼

asked Sep 12 '11 at 05:29 PM

samersamy gravatar image

samersamy
16 7 9 9

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Sep 12 '11 at 05:36 PM

Borgo gravatar image

Borgo
998 9 13 25

I am using Google App Engine to host the application, so how can i add my MIME type to it ?

Sep 13 '11 at 07:16 AM samersamy

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.

Sep 13 '11 at 02:24 PM Borgo
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x831
x54

asked: Sep 12 '11 at 05:29 PM

Seen: 727 times

Last Updated: Sep 13 '11 at 02:24 PM