Skip to content

Uploading files using OneDriveLargeFileUploadTask with only the Files.ReadWrite.AppFolder permission is not possible #917

Closed
@chjohan

Description

@chjohan

Bug Report

Prerequisites

  • Can you reproduce the problem?
  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you perform a cursory search?

For more information, see the CONTRIBUTING guide.

Description

The name of the "Apps"-folder which is used when using the "Files.ReadWrite.AppFolder" permission is determined from the users' language. For english users the folder is named "Apps", bur for norwegian users the folder is named "Apper". As a consuquence it is very inpractical uploading files with "OneDriveLargeFileUploadTask", which requires you to supply the upload path when creating an upload session because, there is no way to get the name of the "Apps"-folder using only the "Files.ReadWrite.AppFolder"-permission.
For this you have to enable the Files.Read permission.

Console Errors: Not applicable.

Screenshots: [If applicable, add screenshots to help explain your problem]

Steps to Reproduce

  1. Create an Azure AD appregistration with the following delegated permissions:
  • User.Read
  • Files.ReadWrite.AppFolder
  • offline_access
  1. Grant permissions to the app from a test user
  2. Upload a large file
const uploadTask = await OneDriveLargeFileUploadTask.create(
	graphClient, fileContent, {
	path: "/Apps/MyApp",
	fileName: fileName,
		rangeSize: 4 * 1024 * 1024, // must be a multiple of 320 KiB
		conflictBehavior: "fail"
	}
);
const response = await uploadTask.upload();

Expected behavior: I either should be able to upload the file without knowing the name of the users "Apps" folder, or be allowed to get the name of the "Apps" folder, with the "Files.ReadWrite.AppFolder" permission, or be able to provide a path using the special/approot path format.

Actual behavior: "Apps"-folder does not exist when the target user has a different language than english, resulting in a 404.

Usage Information

Request ID - Value of the requestId field if you are receiving a Graph API error response

SDK Version - "@microsoft/microsoft-graph-client": "^3.0.2",

  • Node (Check, if using Node version of SDK)

Node Version - v12

  • Browser (Check, if using Browser version of SDK)

Browser Name - Not applicable. Server side.

Version - [The version of the browser you are using]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions