Thomas Mathew
Thomas Mathew

Reputation: 1151

Error in uploading file (from public url) to onedrive using REST API

I am getting an when trying to upload a file to Microsoft OneDrive using its REST API. The file is located on another site(MSDN for this example). Is there a way to upload a file(using its full url path) to onedrive without downloading it first?

REST query - https://apis.live.net/v5.0/me/skydrive/files/fileurl?access_token=mytoken


Error

{ "error": { "code": "request_url_invalid", "message": "The URL contains the path 'blogs.msdn.com', which isn't supported." } }

Upvotes: 0

Views: 916

Answers (1)

Brad
Brad

Reputation: 4192

Your client will need to download the URL and then POST/PUT the content to a specific file name. You cannot specify a URL to another resource instead of the name.

Upvotes: 1

Related Questions