The solution would be to mount the media dir via a custom WebDAV implementation that takes automatically care of all the needed file name conversions and security checks. I once started on a WebDAV implementation at my company but priorities shifted and left this unfinished.
If you'd like a quote for finishing it, I suggest you contact me at CosmoCode (
wiki@cosmocode.de).