0

How can I generate a url which every browser understands, even when I have to deal with arabic/chinese/... filenames?

e.g.

http://someserver.com/files/somehash/لوحة المفاتيح العربية.jpg

I also need to download these files and store them with their original name on the file system; do I have to rename it manually or does the downloadstream handle this for me (I have to connect with a ASCII string to the server so that he understands the filename)...

Thanks for any help!

Niko
  • 1,054
  • 5
  • 25
  • 52

1 Answers1

0

filename should match both in your url and the file system unless you have a middleware service logic.

Encoding the URL using encode and appropriate encoding should help the browsers. Check URLEncoder.encode

Juned Ahsan
  • 67,789
  • 12
  • 98
  • 136
  • so you prefer REAL_FILENAME = STORED_FILENAME? am I not getting any problems with ftp-encoding restrictions? Isn't it better to store it with a "safe" name and save the real name in a DB? – Niko Sep 08 '14 at 06:55