Images being overwritten in Community Server 2008 : DATA LOSS RRS feed

  • General discussion

  • I have discovered an issue that causes images to be overwritten when posting blog entries to Community Server 2008. This is a serious issue resulting in data loss. For a technical analysis of the problem please see

    Strictly, I think this is a Community Server issue because it only started happening on upgrading to CS2008. However, I don't have enough clout with the CS team to get them to notice the problem. Perhaps someone from the Live Writer team could contact Telligent to work out a resolution with them?
    Tim Long
    Saturday, July 19, 2008 1:41 PM

All replies

  • Looking at your post, this is happening when you have pasted images into Writer (from say the clipboard). It might be worth saving the images first but giving them a strong name (one that won't get repeated), say the filename+date for example. I've just confirmed this on a test 2008 setup that I have. It does seem a bit of a backward move by CS.

    [Edit] This would also likely happen with the non-technical preview (ie, the released version).

    SL - Windows Live Platform MVP
    • Edited by Scott Lovegrove Monday, July 21, 2008 11:50 AM See [Edit] section
    Monday, July 21, 2008 11:47 AM
  • Good idea Scott, I hadn't thought of that. I don't know why, but I had assumed that LW would always save the images with its own generated names.

    Most of the images I use in my blog are clipped from other web pages so it is really convenient just to paste them in. The extra step of saving and renaming the image will be a nuisance, but at least it is a workaround.

    Tim Long [MVP - Small Business Server]
    Tim Long
    Monday, July 21, 2008 11:53 AM
  • I couldn't agree more, and I will be in the same situation when LiveSide upgrades to CS 2008 this summer. We [LiveSide] have raised this with telligent though as it is a problem with how they do their central storage. If I hear anymore on this, I'll post in here. I saw your post in the CS forums too, and ignore the comment about it being a caching issue, it's not ;)
    SL - Windows Live Platform MVP
    Thursday, July 24, 2008 12:49 PM
  • I had this reply from Telligent's support manager:



    I wanted to follow up and let you know how much we appreciate the research you have done in tracking down how CS2008 works differently with Live Writer than CS2007 did. 


    Because there was a major change implemented with the file storage system in CS2008, we won't be going back to the system we used in previous versions of CS. 


    I'm sorry this isn't the answer you hoped to receive.  


    Even though the file storage system is working as designed, if you would like to post this as a Bug or Issue for CS2008, there is a forum our developers use.  It's located at http://dev.communityserver.com/forums/288.aspx.

    That seems like a bit of a 'tough luck' response to me. Rather than engage in assigning blame for this problem, I hope that Microsoft will consider updating LiveWriter to generate unique file names that don't rely on the folder name. Even just adding the post title to the image name would help.

    Tim Long
    Thursday, July 24, 2008 1:19 PM
  • Ok everyone, here is the fix.  (I'm Nick on the CS.org forums)

    \source\Blogs\Services\MetaWeblog.cs, the newMediaObject function:

    1        public MetaWeblog.MediaObjectInfo newMediaObject(string blogid, string username, string password, MetaWeblog.MediaObject mediaObject) 
    2        { 
    3            if (ValidateUser(username, password)) 
    4            { 
    5                Weblog weblog = Weblogs.GetWeblog(blogid, truefalse); 
    6                Permissions.AccessCheck(weblog, Permission.Post, CSContext.Current.User); 
    8                if (!WeblogConfiguration.Instance().EnableBlogFileStorage) 
    9                    throw new XmlRpcFaultException(0, "Blog file storage not allowed"); 
    11                try 
    12                { 
    13                    if (mediaObject.bits != null && !Globals.IsNullorEmpty(mediaObject.name)) 
    14                    { 
    15                        string folder = string.Empty; 
    16                        if (mediaObject.name.Contains("/")) 
    17                        { 
    18                            string[] pathsAreas = mediaObject.name.Split('/'); 
    19                            folder = pathsAreas.Length < 2 ? string.Empty : pathsAreas[pathsAreas.Length - 2]; 
    20                            if (folder.Contains("/")) 
    21                                folder.Remove(folder.IndexOf('/')); 
    22                            mediaObject.name = pathsAreas != null && pathsAreas.Length > 0 ? pathsAreas[pathsAreas.Length - 1] : mediaObject.name; 
    23                        } 
    24                        if (!string.IsNullOrEmpty(folder)) WeblogFiles.CreateFolder(weblog.ApplicationKey, string.Empty, folder); 
    25                        string filename = WeblogFiles.AddFile(weblog.ApplicationKey, mediaObject.bits, folder , mediaObject.name); 
    26                        WeblogFile file = WeblogFiles.GetFile(weblog.ApplicationKey, folder, filename); 
    28                        MediaObjectInfo info = new MediaObjectInfo(); 
    29                        info.url = Globals.FullPath(file.URL); 
    30                        return info; 
    31                    } 
    32                } 
    33                catch (System.Exception ex) 
    34                { 
    35                    EventLogs.Warn("An error occurred while uploading a file via MetaWeblogAPI NewMediaObject.""Blog File Storage", 320, ex, CSContext.Current.SettingsID); 
    36                } 
    38                throw new XmlRpcFaultException(0, "Invalid file"); 
    39            } 
    41            throw new XmlRpcFaultException(0, "User does not exist"); 
    43        } 

    I makes a new folder in the filestorage bin with the name of the post.

    I've pinged this fix up the chain in telligent, haven't heard anything yet tho.

    You can download the DLL from http://dev.communityserver.com/forums/p/500673/627499.aspx#627499

    Thanks, Nick
    • Edited by TechieNick Thursday, July 24, 2008 2:56 PM Link was wrong
    Thursday, July 24, 2008 2:52 PM
  • And just to add to Nick's post, when you download the rar file, the dll goes in the web\bin\ folder. Simply rename the old one to CommunityServer.Blogs.Old and drop the new file in (just in case anything goes wrong you have the original to fall back on.

    I have tried this and it does indeed work as expected.
    SL - Windows Live Platform MVP
    Thursday, July 24, 2008 3:15 PM
  • I just found this issue myself. This still has not been fixed by Tellligent as far as I know. I have all service packs and critical updates installed. I have CS2008.5 SP1 Professional Edition. Same issue verified with same problem encountered.

    Monday, March 2, 2009 10:21 PM
  • You might wanna give this plugin a try: http://scottisafooldev.spaces.live.com/blog/cns!FE151030F50B5B37!1819.entry
    SL - Windows Live Platform MVP
    Monday, March 2, 2009 10:38 PM