Windows Live Writer overwriting uploaded files
February 13, 2009 at 10:52 PM
—
Andre Loker
Weird, I didn’t notice it for quite some time. It seems that since version 2009 Windows Live Writer has changed they that uploaded (images etc) files are called. If you look at older posts you’ll see that the images were uploaded to /WindowsLiveWriter/{article name}_{some number}/image_{some number}.png the data folder of my blog. It seems that some smart guy decided to change this behaviour to something short as /{filename}. The blog overwrites this file if it exists so if you were to use the same file name in multiple articles you’d happily overwrite the older version with the new one.
This becomes even more unpleasant if you keep in mind that images that are pasted from the clipboard into WLW will all have the name “image.png”. Guess what: if you publish an article with multiple images pasted from the clipboard you’ll end up with all images being the same.
I hope that this is just some hidden setting in WLW, but until now I couldn’t find it.
Now, actually I did find something. After some time of searching I found a comment in another blog that at least provided an initial hint of how to work on this problem. You can change the format of uploaded file names with a registry key:
HKEY_CURRENT_USER\Software\Microsoft\Windows Live\Writer\Weblogs\(BLOGID)\UserOptionOverrides
where (BLOGID) is different for each blog registered in WLW. Within that key create a string value name fileUploadNameFormat and assign it a string representing the format of the uploaded files, for example WindowsLiveWriter/{PostTitle}_{PostRandomizer}/{FileName}. At least now we have a distinct subfolder per article again. Anyway, still no fancy auto numbering of the images, therefore the problem with multiple pasted images won’t be solved with this registry entry.
Because I don’t have any desire to lose uploaded files I chose for a more conventional solution: I modified the blog software to never overwrite uploaded files. If a file name collision is encountered the file is moved into a subfolder named after some GUID.
It has the drawback that changing an image from within WLW will always cause a new file to be added to the server (instead of replacing the old one). Anyway, I prefer a few more files on the server over overridden files.
Nevertheless I find it a bit weird that I haven’t read much about this issue yet. Maybe it really is only me using some wrong settings?