question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to upload a file into a SharePoint?

See original GitHub issue

I’ve been using O365 for a few days and I’m trying to understand how to upload a new file into a SharePoint.

I’ve tried to call this method on a O365.sharepoint.Site object but I don’t know if this is the right way.

Any advice? 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jjr5330commented, Mar 18, 2020

@pigna90 @janscas I’m struggling to figure out how to download a file as well. An update to the read me that explains in detail how to upload and download files on a SharePoint would be much appreciated.

I have spent the past approx. 10 hours reading through the SharePoint and drive source code and still can’t figure out how to download a file from a folder that is nested within a folder within a folder on my SharePoint.

O365 has so much potential just needs some read me improvements.

Here is my code…

share_point = account.sharepoint()

# I was able to find my SharePoint site_id by using this link as a reference point
# I have no clue how to get the site_id without using this link I couldn't figure that out either
# https://support.cloudhq.net/how-to-find-guids-of-sharepoint-sites/
# this code prints the name of my SharePoint
site = share_point.get_site(site_id)
# this code prints my default drive
my_site = site.get_default_document_library()
# this code shows me my document libraries
default_folders = site.list_document_libraries()
# above code print output looks like this [Drive: Documents, Drive: Preservation Hold Library, Drive: Teams Wiki Data]
# I have no clue how to actually select these folders to dive deeper into my SharePoint
# nor do I know how to get the actual drive id for these items in this list

If either of you could provide some insight it would be greatly appreciated. I also will assist in updating the docs if I can get a quick explanation on how to dive deeper into the layers of folders on my SharePoint and how to find the drive_id.

1reaction
janscascommented, Mar 11, 2020

I’ll update the readme file if it’s ok for you.

Of course! PR are always welcome

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create, upload, and share files in a document library
Upload a file. From your computer, select the file you want and drag it into the document library. Share a file.
Read more >
3 Ways To Upload A Single File To A SharePoint Library
Use the SharePoint Upload button. Drag a file from the file system on the PC to the library. (The drag and drop method...
Read more >
Best ways to upload files to a SharePoint Document Library
The easiest and the most popular way of uploading files to a SharePoint Document Library is the drag and drop method. You can...
Read more >
How to Upload File to SharePoint Online: 3 Fast Ways in 2022
Way 1. Upload File to SharePoint Document Library by “Drag and Drop” ... The simplest and most common way to upload image to...
Read more >
How to Upload Files and Documents to a SharePoint Library
Simply click on the Upload button on the library and select the type of file you want to upload.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found