Description

If you upload a file using the attachments form, the uploaded file will have the absolute pathname if using Internet Explorer (tested with IE6). Firefox and Netscape have the expected behavior.

Steps to reproduce

  1. Go to WikiSandBox

  2. Select "Attachments" from the "More Actions:" drop down.
  3. Browse and select file on desktop.
  4. Click upload
  5. File will have the absolute path name.

Example

There are a number attachments in WikiSandBox now that exhibit the behavior. See http://moinmoin.wikiwikiweb.de/WikiSandBox?action=AttachFile

screenshot.jpg

Details

This Wiki

Workaround

Live with long filenames or teach users to either

Discussion

I wonder if we should fix this, for example, get the basename from the file when getting the form data. It should be very simple:

>>> def basename(path):  
...     return path.split('\\')[-1]
... 
>>> basename('c:\\b\c.jpg')
'c.jpg'
>>> basename('c.jpg')
'c.jpg'

unless we may get a name with \ from another platform?

We can: I just uploaded a file from Mac OS X, named a\b\c.jpg.

  • [get | view] (2005-06-03 18:09:50, 0.0 KB) [[attachment:a_b_c.jpg]]
  • [get | view] (2005-06-03 15:10:07, 62.2 KB) [[attachment:screenshot.jpg]]
 All files | Selected Files: delete move to page copy to page

Maybe enable this fix only for IE? not 100% safe but should be fine.

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/AttachmentFilenameAbsPathNotBasenameWithInternetExplorer (last edited 2007-10-29 19:11:49 by localhost)