0

As the tite says; I'm having problem accessing static files with special character in them.

I have the following folder structure: "war/public/mystuff/images/my_weird_åäö_chars.png", but when I try to access the image with special character in it I get response 404. Any other file not containing special character works.

On the Dev-server everything works fine, but on the Production-server it can't find the files. Even if I escape the characters in the url they can't be found for some reason.

Is there any setting in the web.xml that I should make so that it allows UTF-8 characters in the filename? Or any other settings?

It's might be worth mentioning that I probably can't change how I access these files (meaning I can't for example url-escape the path before I retrieve the file), the page is created using Construct 2 which builds the "app" to HTML5.

Thanks!

Whyser
  • 2,187
  • 2
  • 20
  • 40
  • Can you check the logs to see if there is also a 500 error? Try saving the actual web.xml file in UTF-8 format. – GAEfan Jul 22 '14 at 18:05
  • Thanks for your comment! I only get 404 errors (no 500s). The web.xml has the usual "" at the top of the file. I guess that's not what you meant? I will try re-save the web.xml and format it before I do it. But I'm having a hard time seeing how that will make a differance. :) – Whyser Jul 22 '14 at 19:20
  • I think this is what you are looking for: http://stackoverflow.com/questions/11907764/is-there-a-way-to-use-utf-8-with-app-engine – GAEfan Jul 22 '14 at 20:02
  • Well, I'm not sure which of the answers you are referring to in the link, but I'm not using a servlet. It's static files just "laying" on the server that can't be accessed. I will however try the answer suggesting setting the system-properties or env-variables. Thank you! – Whyser Jul 22 '14 at 20:31
  • None of the suggested solutions works! :( – Whyser Jul 23 '14 at 13:39

1 Answers1

0

I'm afraid you're out of luck. I'm having the same issue with special characters (~ in this instance). And when running mvn appengine:update the log spits out:

Aug 13, 2015 3:56:15 PM com.google.appengine.tools.admin.AppVersionUpload addFile
SEVERE: Invalid character in filename: __static__/img/0~452203~200~150~2

It seems that you cannot upload static files with none-ascii characters so the 404 is really a 404 (the file is not sent to GAE)

There is a bug-tracking thread here, but seems no progress has been made: https://code.google.com/p/googleappengine/issues/detail?id=2211

I've looked around but found no workaround other than to rename your files

jonasl
  • 311
  • 3
  • 6