Closed feddelegrand7 closed 3 years ago
Unfortunately the process for sending file attachments in a chat isn't very well-documented. I also don't have a tenant where I can test this easily.
When you send an attachment using the regular Teams client, do you know where it saves the file? Here, it ends up in my business OneDrive under a folder called "Microsoft Teams Chat Files".
I have a fix in the 'chat-attachments' branch, can you try that?
Hi @hongooi73 thank you for your prompt response.
When I send a png file for example with a client it is saved in the Files tab of the chat. Unfortunately, I'm working on a server that only allows me to install R packages from CRAN. Therefore, I can't test the new branch sorry :/
Best. Fodil.
I've uploaded the tar.gz. You should be able to install it with devtools::install_local
, assuming you're able to download it.
Thank you @hongooi73 I'll try do it. Btw you were right when I send a file in the teams client it's stored here: Documents/Microsoft Teams Chat Files. Thank again.
Ok, let's just make sure exactly where that folder is located. Run get_business_onedrive()
and look for the folder:
od <- get_business_onedrive()
od$list_files()
od$list_files("folder1")
... etc ...
Search through the directories until you find it, and tell me where it is. On my work machine, it's under the root directory.
I'm note sure but it seems that it's located in the onedrive of the company:
C:\Users\mihaddaden\OneDrive - CompanyAlpha\Microsoft Teams Chat Files
Ok, now can you run get_business_onedrive()
and confirm that for me please.
od <- get_business_onedrive()
od$list_files()
It should show up in the root directory listing.
running the above code, I got the following:
I don't have any indication about the directory location.
Excellent, thank you. Line 5 above is the directory we're after. Line 6 looks suspicious though -- what does "Chatdateien" translate as?
It's Chat Files in German.
Right, so things are a bit more complicated than I thought. It looks like Teams can store the files in different locations depending on your language settings.
For now, I've set Microsoft365R to always save files under the English version--localisation is way above my pay grade....
ahhh yes you're absolutely right I think I have changed the language of MSTEAMS in my settings (from German to English), that's why I have now two folders. Should I keep only one (the english version) and remove the other one?
No, just leave them alone. You're not hurting anything by having 2 folders, and deleting one means you'll lose all the attachments inside.
Let me know if you run into problems with the fix.
Sure, I'll try the fix asap. Thank you again for your help.
Hi @hongooi73, sorry for the delay. I've tested Microsoft365R_2.3.1.9000.tar.gz
and it works like a charm, thank you so much again!
Cool! It would be great if you could give the fix a good workout. As said above, I don't have the ability to test this myself so I'm going to need outside help.
Sure, I've tested it sofar to send attachment in private Chats and Channels. I've successfully sent csv files, xlsx, docx, png. Everything seems to work perfectly. Do you need a specific test?
Nothing specific right now, just ping me if anything breaks. Thanks!
Will do! thank you :)
Hi, it's me again sorry ^^
I'm trying to send an image within a private chat (not a channel) using the following code:
Nevertheless, I'm receiving the following Error:
Maybe the problem arises from the fact that we're trying to apply a method from "
ms_channel
" while we're dealing with an "ms_chat
" object?Best.