I have been noticing for some time now, in several MOSS implementations, that spaces in filenames are replaced with underscores on file download/upload from SharePoint. I was blaming this on SharePoint SP1, since I started to notice it around the time of that release, however this discussion on MSDN indicates Internet Explorer 7 is the reason.
To see the behavior, find any document in a SharePoint document library with spaces in the filename, or upload one. Then download the document to your desktop - you can see that the underscores are added in the "Save As" window.
If you are working quickly and not expecting this filename change to happen, you would save the document to your desktop, make edits, and then re-upload it later. Since you didn't actively change the filename, you would expect the document to save over the original in the document library. This is the way SharePoint has traditionally worked. But what you end up with is two copies of the document in the document library.
Disclaimer - I'm sure we can all agree that the best practice in general is to check out / check in your document rather than downloading it to your desktop. (The underscores are not added during checkin/checkout.) But what if someone else has the document checked out, and you can't reach them to ask them to check it back in, and you're under pressure to make edits right away? Or what if you thought you were just taking a copy, but the edits you make on your desktop turn out to be the preferred version? Or what if you haven't fully tested the offline sync capabilities of MOSS 2007, and you want to be absolutely sure the document is accessible when you're offline? These and many other real-world situations could lead to this downloaded-file scenario, which could lead to multiple copies of the same or similar documents in your SharePoint environment, which is exactly what most of us are trying to avoid.
The MSDN thread proposes a workaround, although I will argue that the adding of underscores is not necessarily a bad thing, expecially since SharePoint can cause problems when working with filenames that include spaces. I think it's important to be aware of this download behavior and to work toward minimizing the multiple-copies effect - emphasize checkin/checkout vs. download in end-user training sessions, for example.
One workaround is to right click the file name and choose "Save Target As". That will allow you to download and save with spaces and avoid the underscores.
Posted by: mcodyw | September 30, 2008 at 02:54 PM