Forum Discussion
mbeenen
Sep 06, 2023Copper Contributor
403 Forbidden on Rest-API when trying to use Post or Patch
Hello everyone, I'm trying to use the REST-API of Sharepoint (On-Premise). When I use Get-Requests everything is just fine. As soon as I try to change data using either a Patch or Post Request I ...
TraKieu
Mar 20, 2024Copper Contributor
Hi Mbeenen,
I got a problem when uploading a file to attachment files. For example (http:mysharepoint/sites/mysite/items(1)/AttachmentFiles(FileName='F:/testfile.pdf'). And they cannot understand the ":". I used to work with SP online and there is no problem but with on premise, I don't know how to deal with it. There may be a solution in modifying web.config but I still cannot find it in the server.
If you used to have the same problem, feel free to share with me.
Thank you and have a nice day,
Tra
I got a problem when uploading a file to attachment files. For example (http:mysharepoint/sites/mysite/items(1)/AttachmentFiles(FileName='F:/testfile.pdf'). And they cannot understand the ":". I used to work with SP online and there is no problem but with on premise, I don't know how to deal with it. There may be a solution in modifying web.config but I still cannot find it in the server.
If you used to have the same problem, feel free to share with me.
Thank you and have a nice day,
Tra
- mbeenenJun 21, 2024Copper ContributorHi Tra,
i have not used that endpoint, but other endpoints dealing with files. As far as I understand it, it only expects a filename there, not a path. You propably tried to use your local path to the file. The server has no way to access that file from your local system.
The filename you enter there will be the name for the new file on sharepoint. The content the file is supposed to have has to be sent as a body in the rest call.