Search code examples
windows-phone-7onedrivelive-connect-sdk

WP7 + Live SDK - file overwrite doesn't work


I'm trying to upload a file to SkyDrive using Live SDK. It works well except overwriting existing files. Whenever I try to overwrite an existing file I get the error message "The resource file_name already exists.", although I use the Overwrite option:

_liveClient.UploadAsync(
                   FolderId,
                   Filename,
                   MemoryStream,
                   OverwriteOption.Overwrite);

Is there anything else I need to set? I could try handling the error by deleting the file and uploading again but that's obviously not the cleanest way to do that.


Solution

  • Microsoft admitted here that it's a bug that they are aware of . It will be fixed in the next release. Also, as per answer in that link, the overloaded method works fine:

    _liveClient.UploadAsync(
                   FolderId,
                   Filename,
                   MemoryStream,
                   OverwriteOption.Overwrite,
                   null);