Rename of a file causes "File already exists" to show?

3 posts, 0 answers
  1. David
    David avatar
    26 posts
    Member since:
    Aug 2012

    Posted 03 Mar 2014 Link to this post

    I have a really basic method written for handling the renaming of files using the custom FileSystemContentProvider

    01.public override string MoveFile(string path, string newPath)
    03.    IC_Library.FileInfo info = new FileInfo(DataServer.ConnectionString);
    04.    info.Name = VirtualPathUtility.GetFileName(newPath);
    05.    info.Path = VirtualPathUtility.GetDirectory(newPath);
    06.    info.ClientId = ClientId;
    07.    info.PortalId = PortalId;
    09.    info.MoveFile(path, info);
    11.    return base.MoveFile(path, newPath);

    The file rename works successfully, and everything refreshes properly and looks good, but when the rename completes, and before the explorer repopulates, I get the Javascript alert saying "A file by this name already exists!"

    What's causing this?
  2. David
    David avatar
    26 posts
    Member since:
    Aug 2012

    Posted 03 Mar 2014 in reply to David Link to this post

    Already have more information to share :) the file I'm renaming is something basic like screenshot.3.jpg . When renaming to something like screenshotA, it doesn't show that message.

    But when renaming to screenshot3.jpg, I get that message. Are special characters ignored?
  3. Vessy
    Vessy avatar
    2133 posts

    Posted 06 Mar 2014 Link to this post

    Hi David,

    I tried to reproduce the reported issue with our DB content provider, but the renaming is working properly with it - video. Could you verify that you are using this content provider or you have implemented your custom one?

    In order to provide any further assistance on the case I will need to examine to reproduce the issue on my side. Could you, please, prepare a sample fully runnable project replicating the problem (including all needed references) and send it for a further investigation?

    Kind regards,

    DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

Back to Top