Reputation: 37288
I am uploading images to users OneDrive like this:
POST /drive/items/{folder-id}/children
So now I need to give the user a direct link to the PNG. I'm trying to get a shared link that is direct, so I can place it in <img src="HERE">
but I am having no luck. Dropbox and Google Drive offered these direct links. Does OneDrive as well?
The createLink
endpoint gives a link that takes user to a page, it cannot be placed in img
tag.
Upvotes: 0
Views: 1869
Reputation: 438
You should be able to generate a link according to OneDrive File Picker SDK for JavaScript, demo at https://dev.onedrive.com/sdk/js-v6/js-picker-open.htm
Choose Download link
File #1 Filename: ASCIIfy-StarFunv2.gif File Link: h t t p : / / public.bn1302.livefilestore.com/y3mYIAJ94eR729crwJ_B9nUg0m0tNn3BS5hhonaEz63xSmsEC-kF5Y-iN9poeWIj6QTiXLU3bI0xk8VKcTP5mTYras8b9F5hZ1eUH-wUcAqpA_4oWHbIkldd6KcXviMEb2wIPZV-HWcnpZryo0JES3mSkj6dZxtifzf0WqseXHDKdeV1t7g4SVWs1IluFazqTRq Size: 2108 bytes Link Type: downloadLink Thumbnail Count: 3
"y3mYIAJ94eR729crwJ_B9nUg0m0tNn3BS5hhonaEz63xSmsEC-kF5Y-iN9poeWIj6QTiXLU3bI0xk8VKcTP5mTYras8b9F5hZ1eUH-wUcAqpA_4oWHbIkldd6KcXviMEb2wIPZV-HWcnpZryo0JES3mSkj6dZxtifzf0WqseXHDKdeV1t7g4SVWs1IluFazqTRq" is the file name
Choose Web link
Result File #1 Filename: ASCIIfy-Bear.gif File Link: h t t p s : / / onedrive.live.com/redir?resid=8F99649728BEB2F3!2737&authkey=!ANtMXD2ftQHfxCs Size: 5234 bytes Link Type: webLink Thumbnail Count: 3
Upvotes: 1