ShareFile-NET icon indicating copy to clipboard operation
ShareFile-NET copied to clipboard

Problem moving file to folder

Open Pajoc opened this issue 8 years ago • 0 comments

Hi, I'm using sharefile SDK in a asp.net MVC project and in a REST webservice since last year. One of my share file functionalities consists in moving files from one folder to another. It was working ok until +- 2 days ago. Now (in both projects), when I try to perform this operation, I receive the error code: Forbiden with the message:"Preview status update not allowed."

The dev. account i'm using is not administrator but I have admin rigths on those folders.

Here is my function:

public static async Task<String> MoveFiles(SampleUser user, string OriId, string DestId) { try { var sfClient = await PasswordAuthentication(user, user.oauthClientId, user.oauthClientSecret); // Create a Session await StartSession(sfClient); var folder = sfClient.Items.GetAlias(OriId); var folderContents = await sfClient.Items.GetChildren(folder).ExecuteAsync(); if (folderContents.Feed.Count() > 0) { foreach (var item in folderContents.Feed) { if (item.Id == user.Path) { Uri url = item.url; string x = item.Name; item.Parent.Id = DestId; await sfClient.Items.Update(url, item).ExecuteAsync(); } } }

        }
        catch (Exception ex)
        {
            string x = ex.Message.ToString();
        }

Something changed? I already updated the Nuget package ShareFile.Api.Client to the last version but the problem remains. One of this projects is critical for m notmoving y organization, I really need help to figure out what's happening. Thanks, Paulo

Pajoc avatar Oct 19 '17 11:10 Pajoc