Skip to content

Add-ODItem fails with "Upload error: Forbidden" when uploading a shared file with "Can edit" access #29

@sba923

Description

@sba923

I'm able to download a file that's shared with me with "Can edit" permission by someone else (OneDrive personal) using:

PS> $p=Get-ODSharedItems -AccessToken $auth.access_token | ? { $_.Name -eq 'foo.bar' }
# 'get-oditem -AccessToken $auth.access_token -ElementId $p.id -DriveId $p.remoteItem.parentReference.driveId' fails with 'Get-ODWebContent: Cannot access the api. Webrequest return code is: NotFound '
PS> iwr $p.'@content.downloadUrl' -OutFile c:/tmp/foo.bar

But I can't upload the file once I have modified it:

PS> add-oditem -AccessToken $auth.access_token -LocalFile C:\tmp\foo.bar -DriveId $p.parentReference.driveId -ElementId $p.id                    
Add-ODItem: Upload error: Forbidden

Limitation, bug, or am I am just using the module incorrectly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions