Thanks. As I said, that's what I ended up using. But the problem remains that CuteEditor seems to want and expect no trailing slash, and all the problems I mentioned (with uploading and double slashes) still seem to occur. Suggest you revise your code so it works regardless of trailing slashes. Some of your code already does, but it's not consistent.