Microsoft365R icon indicating copy to clipboard operation
Microsoft365R copied to clipboard

Issue with downloading shared files.

Open RealcoJaneZheng opened this issue 2 years ago • 10 comments

Hi! I found your package really handy but after I updated the package from version 2.3.4 to the latest version, seems I cannot properly download shared files anymore.

For example, if I want to download the first item of the shared files, this is what I did with version 2.3.4 and it worked very well. drv <- get_business_onedrive() drv$list_shared_items("items")[[1]]$download(dest = "test.csv", overwrite = TRUE)

After updating the package, this is what I did. drv <- get_business_onedrive() drv$list_shared_items()[[1]]$download(dest = "test.csv", overwrite = TRUE)

I can still successfully download a file, but the file is not the same as the original file. The original file is a csv file with a dataframe. However, this is a screenshot of a part of the file I downloaded.

Screenshot 2023-10-31 at 5 00 05 PM

Is this the correct way to download a shared file? Was there anything I did wrong? Thank you very much in advance for your help!

RealcoJaneZheng avatar Oct 31 '23 16:10 RealcoJaneZheng

@RealcoJaneZheng have you been able to find a workaround yet? I’m having the same issue and it’s rather inconvenient!

SHogenboom avatar Nov 30 '23 19:11 SHogenboom

@SHogenboom Unfortunately, I haven't found a workaround yet. I reinstalled version 2.3.4 to keep my application working for now.

RealcoJaneZheng avatar Nov 30 '23 21:11 RealcoJaneZheng

@RealcoJaneZheng Thanks! Might consider that as well. For now I created a shortcut to the parent_folder which is connected to my individual drive. Then I can use the normal ‘get_item’ approach. Not ideal tbh, but sufficient for now.

SHogenboom avatar Nov 30 '23 22:11 SHogenboom

Are people still experiencing this bug? Shared items in Business Onedrive/Sharepoint is hard for me to debug, since I don't have access to a business MS365 account right now.

hongooi73 avatar Feb 14 '24 03:02 hongooi73

@elipousson does your sharepointr package have the same problem?

hongooi73 avatar Feb 14 '24 04:02 hongooi73

@hongooi73 I actually hadn't tried the list_share_items() method previously but I am encountering what seems to be a similar error. I do have a batch download function in my own package but it uses get_item and then uses the download method on the item.

So far, I can't tell the difference (if there is any) between an element of the list created with list_shared_items() and get_item() but one works and the other doesn't.

elipousson avatar Feb 14 '24 04:02 elipousson

So far, I can't tell the difference (if there is any) between an element of the list created with list_shared_items() and get_item() but one works and the other doesn't.

@elipousson The info returned by Graph is all in the properties field of the R6 object. If you compare this field in the objects returned by get_item and list_shared_items, do you see any difference?

hongooi73 avatar Feb 14 '24 09:02 hongooi73

The 'shared-item-fix' branch reverts the code to what it was in the earlier version. Can people affected by this give it a go, and tell me if it works?

hongooi73 avatar Feb 14 '24 09:02 hongooi73

@elipousson @SHogenboom @RealcoJaneZheng is the fix working?

hongooi73 avatar Feb 22 '24 04:02 hongooi73

@hongooi73 Yep. I installed from the branch and can confirm that the download method for the ms_drive_item object is working. I didn't do any code review comparing the branch and the existing version so, if there are any additional tests you'd like me to run, let me know.

elipousson avatar Feb 22 '24 19:02 elipousson