Feb 18 2021 12:09 AM - edited Feb 18 2021 12:11 AM
I'm trying to create a new excel file in OneDrive with the below properties of the REST API call.
URL: https://graph.microsoft.com//v1.0/me/drive/root/children Body:
{ "name": "MyFile.xlsx", "file": {}, "@microsoft.graph.conflictBehavior": "rename" }
Header: Content-Type:application/json
With the help of the above properties, I'm able to create the file in OneDrive. But it is created without size & If I try to open the workbook it says Couldn't Open the Workbook Error The workbook cannot be opened.
Basically, whenever I create a new excel file from UI it has a default size of 7.81KB (Could be used for metadata of file).
I have taken reference from https://docs.microsoft.com/en-us/graph/api/driveitem-post-children?view=graph-rest-1.0&tabs=http
Is there anyone who knows how to resolve this issue?
Feb 16 2022 04:38 AM
@harshadpanmand I'm also facing the same issue. did you find any solution to it?
Feb 16 2022 07:20 AM
@ashishPersistent.
I did not found any solution.
One suggested solution I found was, keep empty file(Original file created from UI) at one directory and while creating new file just copy Original file.
Jan 14 2023 05:36 AM