Closed Pilzinsel64 closed 5 years ago
Hello again!
Now it is an issue. I tried to get the direct download like: https://onedrive.live.com/download?cid=025EBB683889A2B9&resid=25EBB683889A2B9!1396&authkey=AJxFQ8726d8On94 It works, but when I call OneDriveGraphApi.GetItemFromDriveById("25EBB683889A2B9%211396", "25EBB683889A2B9") I get this exception. Probably because it needs my authkey (AJxFQ8726d8On94) for this file, but there is no way to do that.
System.NullReferenceException
HResult=0x80004003
Nachricht = Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
Quelle = KoenZomers.OneDrive.Api
Stapelüberwachung:
bei KoenZomers.OneDrive.Api.OneDriveApi.1.MoveNext() bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei KoenZomers.OneDrive.Api.OneDriveApi.<GetItemFromDriveById>d__73.MoveNext() bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei System.Runtime.CompilerServices.TaskAwaiter
1.GetResult()
bei WindowsApp1.Form1.VB$StateMachine_8_LetsGo.MoveNext() in C:\Users\Pascal2\source\repos\WinConTests\WinConTests\Form1.vb: Zeile39
The API is not designed to work with anonymous sharing links other than creating them. Why would you want to revert it to a DriveItem?
I want to download files (e.g. for updater) in my tool and I don't want to put my encrypted account informations in this tool just do download shared files.
However, I've found a workaround by modifying the links for embeding files to be (direct) download links. Then I can download them via System.Net.WebRequest.
Embedded link: https://onedrive.live.com/embed?cid=025EBB683889A2B9&resid=25EBB683889A2B9%211469&authkey=ALgRKMKtYWAC0cU
Download Link: -> Change "embed" to "download" https://onedrive.live.com/download?cid=025EBB683889A2B9&resid=25EBB683889A2B9%211469&authkey=ALgRKMKtYWAC0cU
A feature to do this in your api still would be nice.
So if I understand you correctly, you would like to see support added in the API to perform this operation:
Which effectively would return you the embed link which you can transform into a download link.
Correct?
Closing due to no response received.
Hello!
This isn't realy a issue, but I realy don't know how to get a DriveItem from a public file like this. Or, how can I get a DriveItem from a public folder?
Thanks
Pilzinsel64