Fixed Bug: File Uploads broken for Internet Explorer 6.0
—
!!1!
!
>
—
!!2!
!
Your name:
Bil Kleb !
!3!
!
!
!4!
!
Soks version:
1.0.2
(and older CVS versions)
!
!5!
!
!
!6!
!
Your operating system:
Windows2000pro
—
!!7!
!
!
!8!
!
Your version of
ruby: 1.8.2
—
!!9!
!
!
!10!
!
Your browser:
Internet Explorer 6.0
—
!!11!
!
—
!!12!
!
—
!!13!
!
And please describe the problem below:
!
!14!
!
—
!!15!
!
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.
!
!16!
!
—
!!17!
!
It seems to be IE6 which has the problem.
IE5.2 on the Mac works
as does Netscape 4.76 on Windoze.
!
!18!
!
—
!!19!
!
When a file is uploaded with IE6.0,
it saves the file as a complete
directory path,
e.g.
, a file named
—
!!20!
!
—
!!21!
!
!
!22!
!
C:
\DocumentsandSettings\AB\Desktop\bil_kleb.jpg
—
!!23!
!
!
!24!
!
—
!!25!
!
shows up in the
!
!26!
!
!
!27!
!
directory instead of just
!
!28!
!
!
!29!
!
.
The page source has a
!
!30!
!
!
!31!
!
field like,
!
!32!
!
—
!!33!
!
!
!34!
!
http://somewhere.nasa.gov/Attachment/C:\DocumentsandSettings\AB\Desktop\bil_kleb.jpg !
!35!
!
!
!36!
!
—
!!37!
!
Note:
Soks is running on a Fedora Core 3
(linux)
box.
!
!38!
!
—
!!39!
!
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?
!
!40!
!
!
!41!
!
—
!!42!
!
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.
!
!43!
!
—
!!44!
!
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.
%)
.
—
!!45!
!
—
!!46!
!
Thanks
—
!!47!
!
—
!!48!
!
tamc !
!49!
!