Yes, This has been resolved. Thank you.
Upload File to SharePoint through REST API
Hello,
I am uploading ".xlsx " file into SharePoint online using REST API /_api/Web/GetFolderByServerRelativeUrl('-------')/files/add,
My upload is successful, but noticed after uploading file, it contains some additional comments as per below in the top of file, due to that, I am unable to process file .
Please advise.
Content-Type: application/octet-stream;
name=<....,XLSD>
Content-Transfer-Encoding: binary
Content-Disposition: form-data; name="filename"; filename="filename"
1 additional answer
Sort by: Most helpful
-
RaytheonXie_MSFT 35,866 Reputation points Microsoft Vendor
2021-09-14T02:28:02.81+00:00 Hi @Ramakrishnan Venkatesan ,
Per my test,I uploaded a file successful and correctly with following api:_api/Web/GetFolderByServerRelativeUrl('/sites/abc/FolderTest/Test')/Files/add(url='rename.xlsx',overwrite=true)')
We can set the file name after '/Files/add'. Since the error might caused setting filename by headers.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.