OneDrive file link open issue with windows File Explorer/Picker

Hashir Sheikh 1 Reputation point
2021-09-15T10:14:00.09+00:00

Hi, I am working with office-js add-in with taskpane app. In my application we are using file picker by following code.

<input type='file' accept='.csv, .xls'/>

The problem is that I am unable to read the file from OneDrive shared link. Please check the following screenshot to show the process that how I am doing this.

132379-image.png

132365-image.png

After click open I just read the file using JavaScript file read techniques. following screenshot will describe that what kind of data we are getting.

132393-image.png

In general case of file selection we are getting binary data but here I am getting html data.

Please help me to figure it out, what is the correct way to handle the OneDrive shared file link with window's file picker.

Microsoft 365 and Office | Development | Office JavaScript API
Microsoft 365 and Office | Development | Other
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.