I have a test game I’m trying to put up on my site but it’s giving me an error. It says
“Invalid data file”
“Error details”
When I click on error details it just says “Data file is corrupt (not a Unity Player file).” It works fine on my local machine but this error comes up when I upload it to my server. I’v tried looking at other posts but they were not very helpful. I’m pretty sure I need to add the MIME type to the MIME list but my hosting provider only allows me to do it through a .htaccess file and I’m not sure what to make the Subtype. I’v tried “AddType application/x-unity unity3d” and it doesn’t work. Not sure if I’m doing something wrong or if this is even the problem. And yes I have the web player installed on my computer and all the basic stuff like that… Any help would be appreciated.
Hey Noxorus,
Interesting, can we see the URL?
Sure. Also, not sure if this is the problem or not (I remember reading some “Note” on the unity documentation about editing the html file), but I did edit the html file to add some simple repeating background image and a image header I had sitting on my computer (So don’t laugh, it was from a long time ago!! =D ). url is http://www.knightsofdarknessguild.net/discord
It seems that the DiscordOnline.unity3d file is not at the location the html file expects it to be. I got a file not found error when I entered this URL into the browser: http://www.knightsofdarknessguild.net/discord/DiscordOnline.unity3d
Did you upload the unity3d file to the same directory as the html file?
The official mime type for the unity3d files is application/vnd.unity, so the line to add to .htaccess is AddType application/vnd.unity .unity3d
Yes I did.
But it’s not at the location I posted above. Did you somehow rename it or change the capitalisation of the file name?
No I didn’t. These would be the most common mistakes to make, I’v already re-cheeked all the common things that could be wrong.
Then the only suggestion I have is that you use your ftp client to verify that the file is actually there and then to upload it again.
I’v checked many times already and have reuploaded it a few times now too…
Try clearing your browser cache or build with a different name. I usually include the build version in the build name so this doesn’t happen.
It just means your http server cached part of the unity3d file before it was completely uploaded.
Or you don’t have mime types configured properly.
Or some other server misconfiguration.
If you can open the web file locally, you know it’s your server.
And that it’s being uploaded using Binary format.
I’v also made sure it was uploaded using binary because I remember reading a post you made about someone elses problem =) but it still didn’t resolve the problem. Also, I saw that you were offering to take a look at someone elses files and see if you could find any errors or possibly upload them on your private server. Would you mind doing this for me? I really have no other ideas as to why its not working. I also saw in a recent post you made about someone else with the same problem that it was due to the mime type not being properly set. I’m pretty sure I’m setting my right. I made a .htaccess file with the following code in it:
AddType application/vnd.unity unity3d
and also tried:
AddType application/vnd.unity .unity3d
and I uploaded it to my root directory. Still no luck… If your able to to take a look at the files just say so and I’ll gladly give them to you and it would be very much appreciated.
You might PM motorway as he had a similar problem (see this thread) that he was able to resolve through some IIS 7 magic (if that’s what you’re using).