liveservices / LiveSDK-for-Windows

LiveSDK library for integrating with Live Connect

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UploadOperation is using unnecessary GetUploadLinkOperation

paya-cz opened this issue · comments

commented

After going through the code of UploadOperation.cs and GetUploadLinkOperation.cs, is it actually necessary to issue a separate web request to get the upload link? According to MSDN, it is perfectly valid to generate the upload link client-side, by simply using the following format:

https://apis.live.net/v5.0/{ID}/files/

Where {ID} is folder ID, such as folder.ca1234567ad234c2.

Constructing the upload link in code (instead of issuing a dedicated request to the server) would be much faster and also cleaner solution.

@paya-cz You are absolutely right, upload operation could be updated to detect if you provided that object with a folder id and then attempt to upload to that location avoiding the round-trip on checking the existence of the folder. I'd be happy to accept a pull request that offered this kind of functionality.

At this time we will not be adding a change to reduce the roundtrips, feel free to submit a pull request and refresh this issue.