Closed BurhanEyimaya closed 6 years ago
Hi Burhan,
Is there no inner exception with more information? Are you using a proxy? Can you capture a Fiddler trace while doing the download and see what's really happening on the wire? If you need help examining it, mail it to me privately as it will contain your refresh token which you should not publish publicly.
Hi Koen,
Thank you for your fast response.
Here is the full exception details
TYPE : System.Net.Http.HttpRequestException
MESSAGE: An error occurred while sending the request.
STACK TRACE: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at KoenZomers.OneDrive.Api.OneDriveApi.<DownloadItemInternal>d__106.MoveNext() in D:\Projects\MS\OneDriveAPI\Api\OneDriveApi.cs:line 1010 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult()
at KoenZomers.OneDrive.Api.OneDriveApi.
Sent from Outlookhttp://aka.ms/weboutlook
From: Koen Zomers notifications@github.com Sent: Thursday, December 21, 2017 20:33 To: KoenZomers/OneDriveAPI Cc: Burhan Eyimaya; Author Subject: Re: [KoenZomers/OneDriveAPI] Download File (#9)
Hi Burhan,
Is there no inner exception with more information? Are you using a proxy? Can you capture a Fiddler trace while doing the download and see what's really happening on the wire? If you need help examining it, mail it to me privately as it will contain your refresh token which you should not publish publicly.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/KoenZomers/OneDriveAPI/issues/9#issuecomment-353410488, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHNzqkpPa3w7h8xqBNFGDAw7qNC_-iX-ks5tCpZWgaJpZM4RJ1_L.
Hi,
Also I have tried to upload to the Apps folder.
OneDriveApi.UploadFileToAppFolder("Save.sav");
This works and uploads the "Save.sav" file to Apps folder.
But download fails.
OneDriveItemCollection oneDriveItems = await OneDriveApi.GetAppFolderChildren();
OneDriveItem oneDriveItem = oneDriveItems.Collection.Where(x => x.Name == "Save.sav").SingleOrDefault();
await OneDriveApi.DownloadItem(oneDriveItem, downloadDir);
Here oneDriveItems collection and oneDriveItem variables are valid so it can find the correct files, but download fails. Could you please try to download a file from Apps folder?
Thanks, Burhan Eyimaya
Hi Burhan,
Downloading works fine here. I modified the demo application at the following lines to mimic your scenario:
[cid:image001.png@01D381C7.84745D90] This works well and it nicely stores the LICENSE.md file I have in the App Folder on my OneDrive for Business: [cid:image002.png@01D381C7.84745D90] To my D: drive: [cid:image003.png@01D381C7.84745D90] The Fiddler trace you shared just contains the authentication part. It doesn’t show even attempting any operation after connecting.
The error indicates something is blocking your network traffic on your machine. Could there be a proxy, firewall or anti virus product on your machine blocking this traffic? Try it from another machine on another internet line.
Kind regards,
Koen
From: Burhan Eyimaya [mailto:notifications@github.com] Sent: vrijdag 22 december 2017 13:41 To: KoenZomers/OneDriveAPI OneDriveAPI@noreply.github.com Cc: Koen Zomers koen@zomers.eu; Comment comment@noreply.github.com Subject: Re: [KoenZomers/OneDriveAPI] Download File (#9)
Hi,
Also I have tried to upload Apps folder. OneDriveApi.UploadFileToAppFolder("Save.sav"); This works and uploads the "Save.sav" file to Apps folder.
But download fails.
OneDriveItemCollection oneDriveItems = await OneDriveApi.GetAppFolderChildren(); OneDriveItem oneDriveItem = oneDriveItems.Collection.Where(x => x.Name == "Save.sav").SingleOrDefault(); await OneDriveApi.DownloadItem(oneDriveItem, downloadDir);
Could you please try to download a file from Apps folder?
Thanks, Burhan Eyimaya
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/KoenZomers/OneDriveAPI/issues/9#issuecomment-353590945, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFqlvtgBWWRwljC-HEkvRVd-YSp5s4liks5tC6NYgaJpZM4RJ1_L.
@BurhanEyimaya any luck in getting it to work?
Hi Koen,
Thank you for your attention. Yes it worked. You are right it was a problem related to my network. Thanks again, and sorry for this false warning.
@BurhanEyimaya good to hear it's resolved. Thanks for confirming!
Hi,
Thank you for this great API.
But I have an issue on downloading files from OneDrive. In your demo application I tried to upload a single file "Test.txt" to folder "Test\sub1\sub". Upload completed with success.
But the download operation fails. In error message it says "Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
Thanks, Burhan Eyimaya