Fixed Bug: File Uploads broken for Internet Explorer 6.0

And please describe the problem below:

I finally got around to sitting with some folks that have been complaining that they cannot upload files or pictures. In the past, I’ve always managed to upload without a hitch (when using Firefox and Safari) and most others seemed to be able to upload also.

It seems to be IE6 which has the problem. IE5.2 on the Mac works as does Netscape 4.76 on Windoze.

When a file is uploaded with IE6.0, it saves the file as a complete directory path, e.g., a file named

C:\DocumentsandSettings\AB\Desktop\bil_kleb.jpg

shows up in the attachments directory instead of just bil\_kleb.jpg. The page source has a src field like,

http://somewhere.nasa.gov/Attachment/C:\DocumentsandSettings\AB\Desktop\bil_kleb.jpg

Note: Soks is running on a Fedora Core 3 (linux) box.

As a demonstration, I will attempt to put my picture on my Soks page, Bil Kleb, by using IE6. Strange: when working in IE6 on windows, the broken image icon comes up, but once back at my mac with Firefox, it’s rendering the image?


Ok, the problem seems to be that the characters in the full path (the : and the \) cause problems because some browsers (e.g. Safari, and presumably IE6.0) do not escape them when they make a request.

The fix (in darcs or tar.gz’s) is to strip everything from the upload filename appart from the final filename (bil_kleb.jpg) and then to remove everything that I’m not confident works (leaving A-Za-z0-9.%).

Thanks

tamc

Edit this page or watch for changes using RSS.