Quantcast
Channel: Question and Answer » file
Viewing all articles
Browse latest Browse all 103

Copy file to another folder with REST API

$
0
0

I’m trying to copy a file located in user’s personal folder (OneDrive Pro) using REST API. The resulting link seems to become too long and server returns 400 BadRequest: The length of the URL for this request exceeds the configured maxUrlLength value.

Url looks like this (HTTP verb is POST):

https://<company>-my.sharepoint.com/personal/<user>_<company>_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/<user>_<company>_onmicrosoft_com/Documents/<Folder>/<Folder with guid-like name>/<filename>.pdf')/copyto(strnewurl='/personal/<user>_<company>_onmicrosoft_com/Documents/<Same folder>/<another guid-like name>/<same filename>.pdf',boverwrite=true)

Any help or advice on how to overcome this is highly appreciated.


Viewing all articles
Browse latest Browse all 103

Trending Articles