3

I am putting the question in two lines

Does OneDrive supports direct download URLs for files? Are URLs returned by OneDrive are same for mobile and web ? Does OneDrive returns file versions via rest API calls ?

Read below for more details.


I am building a standalone app which uses various OneDrive REST apis for different operations, e.g. upload/download/update/browse a document/folder. I have following needs which I am not able to accomplish based on readings from OneDrive rest api support page https://msdn.microsoft.com/en-us/library/office/dn659752.aspx.

  1. Direct Download URLs: I want to give user of my app a facility to directly downloading a file. I know currently 'link' property of file object gives a direct view URL which takes user to OneDrive account and from there user can download the file by clicking download button. I need a link for direct download of the file (such link when typed in a browser which has authenticated OneDrive session should directly prompt the download box.)
  2. Are direct view/download link different for browser and mobile cients?
  3. Versions: How do I get version numbers for files programmatically. I do not see version info in JSON objects returned via REST calls. [I have read in one of the post that versions are not supported ]

https://msdn.microsoft.com/EN-US/library/dn631834.aspx?f=255&MSPPError=-2147217396 This link shows a JSON representation of a file object.

Navin Kumar
  • 31
  • 1
  • 4
  • Could you narrow this down to a specific problem you are having? Maybe you might want to break this down into multiple questions since you are asking for different things. If you could provide code snippets of what you have that isn't currently working the way you want it to it would allow us to assist you easier. – Kmeixner Jun 10 '15 at 17:30
  • I'm having the same issue. I'm trying to get a shared link that is direct, so I can place it in `` but I am having no luck. Dropbox and Google Drive offered these direct links. Does OneDrive as well? Were you able to figure it out @navin? – Noitidart Mar 01 '16 at 12:22

1 Answers1

1
  1. Direct Download URL-
    See this link to download from URL Getting BLOB data from XHR request
    1. Yes view/download different for browser and mobile, see below to access download box.

hope you are trying to access some file from your download folder!!
If you, you can use url like this-

file:///storage/sdcard0/download/file-name.mp4  

This worked for me.

Community
  • 1
  • 1
S.Yadav
  • 4,273
  • 3
  • 37
  • 44