views:

1218

answers:

2

I need to implement a flash-based file-uploader, that will allow me to upload multiple files at once and view progress.

I tried Uploadify and SwfUpload and it was quite easy getting them to work.

However, for both I run into problems, when the users try to upload files, that have filenames with special characters (such as Danish æøå or sweedish ö - and others I am sure).

The file uploads fine, but the filename is screwed up:

  • malmö.jpg becomes malmö.jpg
  • æblemoster.jpg becomes æblemoster.jpg

I have of course tried feeding the files to my upload-scripts without using flash - and then they work fine. So from what I can tell, the flash upload object(s) and/or the javascript grabs the file - and screws the filename up somehow.

Has anybody encountered something similar - and maybe have an idea about how I can make this work as intended?

+3  A: 

Most likely the SWFObject input sends UTF8 encoded data, and the script on the server side handles them as ISO-8859-1. For a quick fix (if you work with PHP on the server side), try utf8_decode() on the incoming filename.

If I were you, I would think about simply filtering out all umlauts and converting them into their non-umlaut equivalents or "o", "a", "u". It makes life easier.

Pekka
+1 for good idea on the character replacements!
Mark Redman
Well, us Krauts and Scandinavians, we have those every day... :)
Pekka
A: 

Since flash is used in both cases, I assume that flash is either not decoding the filenames it reads in or encoding the filenames it posts (or both).

one would need to open the flash .fla file to check the decoding/encoding.

Mark Redman