filip
filip

Reputation: 1503

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.

Upvotes: 1

Views: 419

Answers (2)

filip
filip

Reputation: 1503

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);

Upvotes: 2

Cybermaxs
Cybermaxs

Reputation: 24558

When your upload a file, and a file with the same name already exists in the same location in SkyDrive, the default behavior is for SkyDrive to overwrite the existing file. You are not required to specify OverwriteOption.

From my point of view, there is a problem else where. Try to use another folder and show a little more code.

Upvotes: 0

Related Questions