Upload and Delete file to Sharepoint with Python

Поделиться
HTML-код
  • Опубликовано: 9 окт 2024
  • НаукаНаука

Комментарии • 197

  • @peterkatongole5984
    @peterkatongole5984 Год назад

    Great work Lu. I just stumbled on your Channel and I wanna say, you have really good content. If all content creators produce real hands-on content and not just talking, they would inspire so many people to get into coding and tech. Keep up the good work

  • @chaticassaldana
    @chaticassaldana 4 месяца назад

    Thank you very much, I had been trying for almost 9 hours to use a library that could be uploaded to lambda, since the others are extremely heavy and the one you used was perfect and served 10 times, thank you very much.

  • @marklopez1870
    @marklopez1870 2 года назад +1

    Hi Lu, I just subscribed to your channel. Thanks so much for the content!
    I have 200,000+ files I need to move from our file server to SharePoint, I would like to use a hybrid folder/metadata system to catalog everything instead of the current structure which has folder nested within folder nested within another folder and so on. This video helped me get one step closer to that goal, thank you so much

  • @sanjeevKumar-eg6hp
    @sanjeevKumar-eg6hp Год назад +2

    Thanks for a such detailed explanation of the code and also for the demo. I can't thank you enough for this. Really appreciate your time and effort ❤

  • @felipecustodia5329
    @felipecustodia5329 3 года назад +1

    I am Brazilian and you are awesome! Thanks mannn!!!

    • @codingwithlu
      @codingwithlu  3 года назад

      Thanks for watching and glad you like it.

  • @ashwinireddypingali2994
    @ashwinireddypingali2994 3 года назад +8

    Hi Lu,
    Thanks, Very helpful.., Can you also make a video , that how can we download the files from share point , where the Microsoft share point is having
    multi factor authentication.

    • @codingwithlu
      @codingwithlu  2 года назад

      MFA can't be done with SharePlum. The work around is to create a new user that is not setup with MFA and only allow this user access to do specific things. I'm doing some additional testing to see if there is another option using Python, so I will let you know what I find

    • @mikecon4097
      @mikecon4097 2 года назад

      @@codingwithlu Hi Lu
      were you able to find any solution for multi-factor authentication?
      my organization is having multi-factor authentication and it used ping ID passcode to log in, so using share plum I am unable to login,
      can you pls make a video or share your git hub link for multi-factor authentication
      Thankyou

  • @pradeepag161
    @pradeepag161 3 месяца назад

    Thank you this help!! Your Office365 series is also helpful!!

  • @andiezabdi
    @andiezabdi 2 года назад +1

    hello sir.. new susbscriber here invited by cris jay fajutag..
    watching your videos.. enjoying it

  • @tetzki9962
    @tetzki9962 2 года назад +1

    This helped me with my current project. Thank you!

  • @genaugenaugenau
    @genaugenaugenau 2 года назад +1

    Great walkthrough, very well explained.

    • @codingwithlu
      @codingwithlu  2 года назад

      Glad you liked it. I do have newer videos with a newer package to connect to SharePoint. The package has a lot more features then Shareplum.

  • @subhashkumar209
    @subhashkumar209 Год назад

    Hi Lu, Thank you for sharing wonderful video. Actually, I had used the shareplum via google search and working on my logic but later on when I finished my project. I realized that the PDF files that I copied from Azure blob storage to sharepoint are corrupted. Any idea why?
    Here are my project infomation:
    1) we have very large zip files being sent every month by a dataprovider. These zipped files containers different folder and inside those folders we have large PDF files.
    My job is to extract these files on sharepoint. I didn't find a solution to extract these files directly on sharepoint. So, I copied all these zipped files to azure blob storage, then extract it in another directly and copy these extracted files from Azure blob to sharepoint. In this entire process, all works well but when I opened the PDF files in sharepoint it is corrupted. I have checked that it was a correct zipped file sent by data provided. I Opened this PDF and it worked. When I copied to blob and extracted and tried to open the pdf it works. but right at the last stage when I moved it to sharepoint and I tried to open the pdf it is corrupted. Any idea how I can acheive it. It's been almost 20 days now and it couldn't be solve. Any help would be very much appreciated. Hope you can make a video for this process which will help millions of data engineers. Thanks in advance!!!

  • @madgains9130
    @madgains9130 2 года назад +1

    This was incredibly helpful thank you for everything here!

  • @ViTK0_
    @ViTK0_ 3 года назад +3

    Great Video Lu, thanks a lot. Subscribed. Can you please also cover how to dowload files from sharepoint?

    • @codingwithlu
      @codingwithlu  3 года назад +2

      Sure thing. I will put a video together over downloading file and let you know once it is published to RUclips

  • @jamieurwin1458
    @jamieurwin1458 3 года назад +5

    Hi Lu,
    Thanks so much for this video, it is really helpful. I have got this working and it is great for smaller files. However, I tried to upload a larger file (190 mb in size) and I received an error on this line - self._folder.upload_file(file_content, file_name):
    shareplum.errors.ShareplumRequestError: Shareplum HTTP Post Failed : HTTPSConnectionPool(host='XXX.sharepoint.com', port=443): Read timed out. (read timeout=3)
    Do you have any ideas where I can increase this read timeout?

  • @akash-tj8ru
    @akash-tj8ru 3 года назад +2

    hi LU ..plz make a video for updation of excel sheet on sharepoint

    • @codingwithlu
      @codingwithlu  3 года назад

      Just to make sure I understand, you want to be able to push updated version of excel file to SharePoint so it will override existing excel file?

  • @haisamrazzak9691
    @haisamrazzak9691 3 года назад +4

    Hi Lu, can you make a video about accessing sharepoint list on python?

    • @codingwithlu
      @codingwithlu  3 года назад

      Sure, I will put something together for you and let you know once it is published

  • @ivandelgado9887
    @ivandelgado9887 4 года назад +1

    great video
    i like to know how download shared filles from sharepoint using python. Thanks

    • @codingwithlu
      @codingwithlu  4 года назад +4

      Sure, i will put a video together showing you how to download files from SharePoint. I will you know once i upload video.

  • @InfinBANKMarketing
    @InfinBANKMarketing Год назад

    Amazing! Great job! Thanks, Lu!

  • @francisnathan6655
    @francisnathan6655 3 года назад +1

    Very cool video. Any idea how to create new blank site pages and how to edit the content after creation ? Would love to see a video or some hints for this one. Thanks !

    • @codingwithlu
      @codingwithlu  3 года назад

      This I'm not sure able. Just curious, are you creating many new site pages? If you one option would be to use Selenium to automate the creation of new pages.

  • @vitormarcondes6829
    @vitormarcondes6829 2 года назад +1

    Hi Lu,
    Thanks for the video. It is very helpfull. :D

  • @koys1000
    @koys1000 2 года назад +1

    Hi Lu,
    I am trying to a similar thing however My code works uploading file into SharePoint but I need the Dataframe to be uploaded in excel rather csv..
    Please can we connect to discuss more?

    • @codingwithlu
      @codingwithlu  2 года назад +1

      Sure look at the profile and you will see a calendly link to book some time with me. We can review in more details and I can make a video over it

  • @Nelsonlocuras
    @Nelsonlocuras 3 года назад +1

    Thanks Lu! excellent explanation. I´ll try it.

  • @ash_07666
    @ash_07666 2 года назад +1

    Hi Lu, can you help with how did you configure config.json? I'm a beginner trying to learn from your content.. I'm using a pycharm IDE

    • @codingwithlu
      @codingwithlu  2 года назад

      What issues are you having with the json file? Are you getting any error messages?

  • @venacze
    @venacze Год назад +1

    You are the best, thank you.

  • @ghawes85
    @ghawes85 2 года назад +1

    Hi Lu, thanks for the video. This tutorial was great! I was able to get this up and running like yours. However, if I try to create more then one new folder in the path, it returns a 500 Server Error. Any idea how you create multiple subfolders? Thanks

    • @ghawes85
      @ghawes85 2 года назад

      For anyone else looking at this, I basically iterate through the folders, and add a file per level, then delete the files as I go. If there is a better way, would love to know.

    • @codingwithlu
      @codingwithlu  Год назад +1

      There is a way. I will need to update the code to handle it. In this video I'm using the package "shareplum". I have started using another package "Office365API" which is a bit better. I will make a video related to this but it will be using the Office365API package.

  • @MrLenzi1983
    @MrLenzi1983 2 года назад +1

    Hei Lu, any email with access to the sharepoint is able to upload files like this? or is this a "owner/admin" some email like this?

    • @codingwithlu
      @codingwithlu  2 года назад

      In order to upload/delete in SharePoint, the user account will need to have access to site. I'm doing some testing over email account not having access to site, but limited access to folder only

  • @adilsonchrestani
    @adilsonchrestani 3 года назад +1

    great video! Thank you for your time Lu.

  • @lucasscianni947
    @lucasscianni947 Год назад

    Hi Lu! Is there a way to upload a dataframe as a excel/csv file without saving the file in the local machine?

  • @maxgom4734
    @maxgom4734 4 года назад +2

    Another question. Do we need to register with Azure to gain access to sharepoint using python?

    • @codingwithlu
      @codingwithlu  4 года назад

      You will need a Microsoft 365 account for the SharePoint site you are trying to access. As long as you have that you will be able to use Python with SharePoint

  • @jmstampe
    @jmstampe 3 года назад +1

    Lu, I would love to see how to perform file CRUD capabilities for on-premise SharePoint. I’m a beginner in Python and would love to learn more.

    • @codingwithlu
      @codingwithlu  3 года назад

      Hello Jonathan,
      Which version of on-premise SharePoint are you using? I actually started back in the days uploading/deleting with files with SharePoint 2007. it is actually a bit easier with on-premise but there are a few gotchas

    • @jmstampe
      @jmstampe 3 года назад

      @I am Lu great to hear back. I use SharePoint 2016 on-premise. I did manage to get something working using a mix of the requests_ntlm module and the “application/vnd.ms-excel” content-type header (downloading and uploading Excel files). If there is another way, however, I’d love to learn more.

    • @JohnForbes
      @JohnForbes 3 года назад

      *premises

  • @acomathes
    @acomathes 3 года назад +1

    This is such a helpful video! Thanks a lot man.

  • @gmonkman
    @gmonkman 2 года назад +1

    Respect .. thanks for sharing

  • @quironaquariano
    @quironaquariano Год назад +1

    Perfeito. Muito bom conteudo, ajudou muito. Continue partilhando. Obrigado

  • @zaphodbeeblebrox5973
    @zaphodbeeblebrox5973 3 года назад +1

    This was very useful, Is there a way of deleting the folder once it is empty? I have tried the delete_folder method in shareplum? I think I have the relative URL but it keeps erroring (don't ask why I need to do this!)

    • @codingwithlu
      @codingwithlu  3 года назад

      I never tried deleting a folder, but let me does some testing and if I have success I will let you know

  • @melisting4410
    @melisting4410 Год назад

    Hi Mr Lu, thank you for this
    How can I build a sync logic for a folder on premise and sharepoint?

  • @vuaphapthuathighlights
    @vuaphapthuathighlights 3 года назад +1

    Thanks you very much. Can you make a video about how to get the Shared Link after uploading to sharepoint ?

    • @codingwithlu
      @codingwithlu  3 года назад

      So one option would be after you upload a file, get the meta data for all the files in the folder. Below is a function that you can add to sharepoint.py class. It will return a list of metadata for all files and there is a key called 'LinkingUrl' that will give you the share link.
      def file_meta(self, folder_name):
      self._folder = self.connect_folder(folder_name)
      return self._folder.files

  • @viliamgregus7543
    @viliamgregus7543 Год назад

    Hi Lu, do you have an idea how to connect to the sharepoint using your code via proxy?

  • @DennisSpohn
    @DennisSpohn 3 года назад +1

    Thank you so much! Great work and it is much appreciated.

  • @abdellahitdev6862
    @abdellahitdev6862 3 года назад +1

    Thanks man, you're amazing

  • @fabrizio-6172
    @fabrizio-6172 2 года назад +1

    Hello, thank you so much. I am wondering how we can manage p7m files inside SharePoint by using the python script to extract the readable PDF.
    Tha ks!

    • @codingwithlu
      @codingwithlu  2 года назад

      This will consist of a few steps. First decrypt p7m, then read email attachment and get attachments, then save to some location. A bit more complex, but I will add it to my list of videos to make and maybe do a video over it

  • @rickmedlin5389
    @rickmedlin5389 2 года назад +1

    I'm trying to use SharePlum (and other Python API's for Sharepoint) to simply upload documents to a given folder. If I use your configuration or others, the error returned is 'AADSTS53003: Access has been blocked by Conditional Access policies. The access policy does not allow token issuance'.
    Does the Sharepoint admin need to make some adjustment to allow token issuance or is there something I can do in my app?

    • @codingwithlu
      @codingwithlu  2 года назад

      Yes, when you receive a Conditional Access policies error, this is due to some policies that have been setup by your organization. For example some of the policies my be only allow Windows OS system to connect. Or specific IP's or geography location. It just depends on what policies your admin has applied. As you admin if they can let you know and hopefully its something that you can adjust on yourself to me it work

    • @akshitabasera1608
      @akshitabasera1608 2 года назад

      ​@@codingwithlu​​ Hi Lu , I am getting the same error is there anything I can adjust that will help in resolving the error.

  • @rom92i
    @rom92i 2 года назад +1

    Hi Lu, big thanks for this video, everything is fine for me except this : 500 Server error : internal server error. Is it because my teams doesn't give enough rights ? Or cause of caching ? If u don't know it's ok ans thx if u respond

    • @codingwithlu
      @codingwithlu  2 года назад

      I'm going to assume that the SharePoint doc library variable may not be set correctly. The {Document Name} in the json file needs to be the root Document folder that you are trying to connect to. Can you confirm that is correct?

  • @johnstoia8153
    @johnstoia8153 4 года назад +1

    Hi Lu,
    Thanks for the video. Any possibility of uploading this code example to github or something? I am following along step by step but would be easier to see the whole thing at once.

    • @codingwithlu
      @codingwithlu  4 года назад +1

      Sure thing. I will create a account for this channel and upload all sources code for projects going forward. I will send you account like in a few

    • @johnstoia8153
      @johnstoia8153 4 года назад

      @@codingwithlu thank you Lu!

    • @johnstoia8153
      @johnstoia8153 4 года назад +1

      Hi Lu, just following up on this! Thanks

    • @codingwithlu
      @codingwithlu  3 года назад +1

      Hey sorry for taking so long. I have upload the source code and will be upload all source code going forward for future video. You can access code at github.com/imalu-coding/python-upload2sharepoint

  • @juliocardenas4485
    @juliocardenas4485 3 года назад +1

    Very useful. Thank you!

  • @vaibhavagrawal9059
    @vaibhavagrawal9059 3 года назад +2

    hello Lu, I am getting the error:
    Exception: ('Error authenticating against Office 365. Error from Office 365:', "AADSTS50005: User tried to log in to a device from a platform (Unknown) that's currently not supported through Conditional Access policy. Supported device platforms are: iOS, Android, Mac, and Windows flavors.")
    Please help me to resolve this.
    I am using office365 sharepoint provided by the company

    • @ahmedbrhili1965
      @ahmedbrhili1965 3 года назад

      Got the same Error did u find the solution for it ?

    • @vaibhavagrawal9059
      @vaibhavagrawal9059 3 года назад

      @@ahmedbrhili1965 No, I didn't get the solution

    • @codingwithlu
      @codingwithlu  3 года назад

      So the error that you are receiving tells me that you company has add conditions on what can access Office 365. These setting are configured under Azure Active Directory Admin Center > Enterprise Applications > Conditional Access. You may need to get with you company system admin and ask which policies are in place for device access. For example if you are using a non work pc to run your scripts that may be the issue.

  • @danielgarciaf.429
    @danielgarciaf.429 Год назад +1

    Hi, Lu, tis there a way i can talk to you about an issue i got running this script?

    • @codingwithlu
      @codingwithlu  Год назад

      Hello Daniel, sure you can look at my calendar calendly.com/iamlu/ and book some time.

  • @chrisparkinson9132
    @chrisparkinson9132 3 года назад +1

    Hi Lu, this was a super helpful video. Unfortunately I keep running into the same error: "Exception: ('Error authenticating against Office 365. Error from Office 365:', 'AADSTS53003: Access has been blocked by Conditional Access policies. The access policy does not allow token issuance.')". It doesn't seem to be a problem with MFA. Do you have any recommendations?

    • @codingwithlu
      @codingwithlu  3 года назад

      Hello Chris, so when you get a Conditional Access policies error, this is due to the how the Azure Polices are setup for your Microsoft 365 tenant.
      The admin of your tenant may have setup either location or device policies. I would recommend to get with the Admin of your 365 tenant and ask what Conditional Access polices have been setup.
      Also, I have a video in the queue that I will be making of going over all the different option that are available for Conditional Access and test a few out to see how they work.

    • @ches5735
      @ches5735 2 года назад

      ​@@codingwithlu what policies would need to be used ?

  • @venkatk3098
    @venkatk3098 2 года назад +1

    HI Lu, thank you for your video and it is very useful.. I'm getting an error while connecting to SharePoint:
    Error code snippet # 'Error authenticating against Office 365. Was not able to find an error code. Here is the SOAP response from Office 365'
    Could you pls what would be the solution for this?
    FYI- I'm using my company office 365 and windows 10.

    • @codingwithlu
      @codingwithlu  2 года назад

      So this may be due to your company using SharePoint On-Premise. If that is the case I have another video on how to connect to Share Point On-Premise that you can watch that should help you out.

    • @bmanderso
      @bmanderso 2 года назад

      @@codingwithlu So, 1. great vid & code. 2. I'm seeing the same error, but I know that we're using hosted sharepoint. I think I'm stuck on authenticating, and I know that I can add the file to the site using my account, but using the same account in the config.json, I get the above error. I've tried my email address, and my account name. What would you suggest trying to auth with?
      Thanks again

  • @raghvendrakumar1882
    @raghvendrakumar1882 3 года назад +1

    Hi Lu, I faced the following error "string longer than 2147483647 bytes" as I need to upload files of size 4 GB. Can you provide any work around please

    • @codingwithlu
      @codingwithlu  3 года назад

      I'm doing some testing over uploading large files. If i have success I will make a video. I will let you know what I find.

  • @Freitas512
    @Freitas512 2 года назад +1

    Hi, I didn't understand what I'm supposed to put inside doc_library. Can you help me with that?

    • @codingwithlu
      @codingwithlu  2 года назад

      The "doc_library" key will be the starting folder name that you will be accessing. For i.e. if you have two folders in Document library, one called "Cars" and the other called "Trucks", and you won't to load files into the "Cars" folder, your doc_library will be set to "Cars". Hopefully that makes sense.

  • @erikf826
    @erikf826 3 года назад +1

    Are there any solutions for SharePoint domains that have multi-factor authentication? This is unfortunately blocking me from uploading. Thanks in advance!

    • @codingwithlu
      @codingwithlu  3 года назад +1

      For multi-factor authentication I don't believe there is a way using SharePlum package as is. The work around would be in Azure Admin Center to all that user to skip multi-factor authentication which can be done by white listing an IP address. That is not an ideal solution so I would recommend creating a new user (jobs@company.com) and have the new user not setup with multi-factor authentication and that user will be used for any job automated task that you may have.

  • @nihitchoudhary710
    @nihitchoudhary710 2 года назад +1

    Hi Lu, I am facing the problem with authentication.
    Exception: ('Error authenticating against Office 365. Error from Office 365:', 'AADSTS50126: Error validating credentials due to invalid username or password.')
    Could this be due to MFA or alphanumeric password passed as string?

    • @codingwithlu
      @codingwithlu  2 года назад

      This your account have MFA enabled? If so that will be the issue, since this script doesn't work with MFA

  • @DalisYn
    @DalisYn 3 года назад +1

    when trying to connect the file I get File "C:\Program Files\Python38\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
    json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)"

    • @codingwithlu
      @codingwithlu  3 года назад

      Can you share the file if possible or at least a sample file that is similar?

  • @adolfogorjon9989
    @adolfogorjon9989 2 года назад +1

    Hi Lu, I have a question, how can we avoid creating a new folder in sharepoint?

    • @adolfogorjon9989
      @adolfogorjon9989 2 года назад

      I already solved it, for those who have the same situation, just leave the name of the destination folder in project empty, since it is assigned in the config path

    • @codingwithlu
      @codingwithlu  2 года назад

      If you specify a SharePoint path that doesn't exist i believe it will create new folder. Do you know in advance if that path exist already? I will have to do some testing to see if folder can be checked if exist

  • @yashgupta2933
    @yashgupta2933 2 года назад +1

    What happens once file is uploaded and ran the script again will it creates duplicate file

    • @codingwithlu
      @codingwithlu  2 года назад

      If you upload the same file again it will overwrite old with new file

  • @twentymiles20
    @twentymiles20 3 года назад +1

    Hi Lu, thanks, very useful... Could you make a video where you automatically connect a Sharepoint list with the elements which are contained in an Excel file. In the company environments, this is a very common feature... By the way, subscripted and thumb up :)

    • @codingwithlu
      @codingwithlu  3 года назад

      Hello Luca, just to make sure I understand your request, are you looking to have a Sharepoint List created from an Excel file located on local/company network? Or do you want the Excel file to be linked to a Sharepoint list, so when Excel file is updated it will also update Sharepoint list?

    • @twentymiles20
      @twentymiles20 3 года назад

      @@codingwithlu thanks for your answer. The second one. The excel should be linked to the sharepoint list and when you edit the excel or download the updated excel version from Internet again overwriting the existing one, the sharepoint list should be update with the excel automatically. That's it.

  • @maheshganegoda8564
    @maheshganegoda8564 3 года назад +1

    Is the authentication works this way when you have Azure AD integration?

    • @codingwithlu
      @codingwithlu  3 года назад

      Microsoft 365 using Azure AD by default, so if you a identity in Azure AD and access to SharePoint, the authentication should work.

  • @FilmfanOliver1992
    @FilmfanOliver1992 3 года назад +1

    Is there an API point to see if a file has been modified in Sharepoint ?

    • @codingwithlu
      @codingwithlu  3 года назад

      If you want to know if a file has been updated, the best option for that is to create a subscription (Webhook). This will notify you when data has changed. For this you will need a service to receive URL request. If this is of interest let me know and I will add it to my list of videos to make.

    • @FilmfanOliver1992
      @FilmfanOliver1992 3 года назад

      @@codingwithlu Hi, yes a service to receive URL requests from webhooks would be interesting, I just want to know if a file has changed or been added in sharepoint

  • @djravelaw
    @djravelaw 3 года назад +1

    is it safe to use in production application?

    • @codingwithlu
      @codingwithlu  3 года назад +1

      So the SharePlum package is very stable so from that aspect, yes you can use in production. The code that I provided in my video, there are a few things to do a bit different, like for i.e. the config values I would have them as environment variables instead of json file and there some code cleanup I would do.

  • @maxgom4734
    @maxgom4734 4 года назад +1

    Great videos I am Lu. I am in the middle of a project where I need to upload and overwrite the same file in sharepoint over a period of time, say every 10 mins. Will this method let me do that?

    • @codingwithlu
      @codingwithlu  4 года назад +1

      Yes this method will work. It will override the existing file

    • @maxgom4734
      @maxgom4734 4 года назад

      Thanks for the reply I am Lu. Really appreciate it.

  • @saypap
    @saypap Год назад

    Hi Lu, On corporate network how do we verify SSL certificate?

    • @mafiagamer7307
      @mafiagamer7307 5 месяцев назад

      ask your it team to do it they'll do

  • @omoladeariyo3295
    @omoladeariyo3295 2 года назад +1

    Thank you very much for this video. I ran into this Exception: ('Error authenticating against Office 365. Error from Office 365:', "AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access ''.") probably because my office 365 was setup to seek 2FA. How do i find away around it.

    • @codingwithlu
      @codingwithlu  2 года назад

      So this error is most likely due to when you are trying to connect to Office 365 outside your organization network and in those cases you need to 2FA authentic. Because of how 2FA authentic works the only work around would be to have your admin to create a new user that is not setup for 2FA and they can limit that account to have specific access.

  • @yilu3219
    @yilu3219 2 года назад +1

    ImportError: cannot import name 'Site' from partially initialized module 'shareplum'

    • @codingwithlu
      @codingwithlu  2 года назад

      Can you provide any additional error logs? You can email it to me if you like at contact@iamlu.net

  • @batniku
    @batniku Год назад +1

    Hi...
    Traceback (most recent call last):
    File "c:\Users\Nikhil Lokhande\Desktop\app\project.py", line 1, in
    from sharepoint_api import SharePoint
    File "c:\Users\Nikhil Lokhande\Desktop\app\sharepoint_api.py", line 17, in
    SHAREPOINT_SITE = config['site']
    KeyError: 'site'
    i am getting this error ..plz help!!!

    • @codingwithlu
      @codingwithlu  Год назад

      Can you confirm that you have a config.json file with all the information related to SharePoint? It's missing file or the config.json is not read

  • @varunrawat6536
    @varunrawat6536 4 года назад +2

    sir can u please tell us how to download a file using shareplum library..🙏

    • @codingwithlu
      @codingwithlu  3 года назад +1

      I will make a video on how to download files. I will let you know when video is created

    • @robbyl6863
      @robbyl6863 3 года назад

      @@codingwithlu is that on the way? reading data from share point...
      awesome videos! thanks!

    • @codingwithlu
      @codingwithlu  3 года назад

      @@robbyl6863 I'm working on a video related to SharePoint that will be released this week. I will let you know once it is available

  • @xl5965
    @xl5965 Год назад

    My error text says that -> Exception: ('Error authenticating against Office 365. Error from Office 365:', "AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access ''.")

  • @thomazmachado3824
    @thomazmachado3824 3 года назад +1

    I have this error:
    Error authenticating against Office 365. Error from Office 365:', 'AADSTS50126: Error validating credentials due to invalid username or password.
    But my user and pass are correct. Can you help me?

    • @codingwithlu
      @codingwithlu  3 года назад

      Hey Thomaz, can you confirm if your Office 365 account is through Microsoft or was it provided from another provided like GoDaddy?

    • @rickytruong3581
      @rickytruong3581 3 года назад +1

      @@codingwithlu Hi, I was this error same as Mr. Thomaz. I have Office 365 account from my company: vietjet.sharepoint.com/.
      What should I do too solve this error? Do I need IT deparment help anything?
      Thank you so much

    • @codingwithlu
      @codingwithlu  3 года назад +2

      Hello so after doing some research there is a authentication bug with Shareplum package and it's very odd because some have this issue but other do not. One of the comments mentioned on Github (view link below) that this may be due to multi-factor authentication being implemented on Office 365.
      What I will do is make another video that shows uploading to SharePoint but using the request package.
      I will let everybody know once the video has been uploaded.
      github.com/jasonrollins/shareplum/issues/84

  • @poloperson4072
    @poloperson4072 3 года назад +1

    Could you show how to upload the meta data along with the file?

    • @codingwithlu
      @codingwithlu  3 года назад +1

      I believe that you can't add metadata when you originally update the file, but once the file is uploaded then you can do and update request update the metadata to the file that you uploaded.
      I will put a video together showing the process.

    • @gaddeanudeep2611
      @gaddeanudeep2611 3 года назад

      @@codingwithlu hello Lu, Did you upload a video or post on this ?

  • @warnersandovalelizondo6458
    @warnersandovalelizondo6458 3 года назад +1

    I got the error Shareplum http post failed 403 client error forbidden for url. Is this a code problem or server side problem?

    • @mennocromwijk8804
      @mennocromwijk8804 3 года назад

      I have the same problem, did you already solve it? Or could I am Lu help us?

    • @nedcius
      @nedcius 3 года назад +1

      I faced the same problem and fixed it. What your problem could be, is that your sharepoint is in another lanuage (Mine is in Dutch). So i had to change the config file and translate the 'Shared Documents' part to Dutch. That did it for me.

    • @codingwithlu
      @codingwithlu  3 года назад

      did Niels Edcius solution fix your problem? If not let me know and I will look into it.

    • @harpreetsekhon3847
      @harpreetsekhon3847 3 года назад

      @@codingwithlu this is very helpful video, but I have same error "Shareplum HTTP Post Failed : 403 Client Error: Forbidden for url:"

    • @codingwithlu
      @codingwithlu  3 года назад

      Hello can you confirm that you are using Office 365? If you are for the Site version are you using "Version.v365"? Normally when using Office 365 online you have to make sure the current version is used.

  • @brunoaranda9437
    @brunoaranda9437 3 года назад +1

    is it possible to send an entire folder?

    • @codingwithlu
      @codingwithlu  3 года назад

      What you can do in this case is create the folder first and then upload all the files that need to be uploaded.

  • @cianobrien7949
    @cianobrien7949 2 года назад +1

    Getting the following error:
    Traceback (most recent call last):
    File "C:\Users\co\OneDrive \Desktop\Files\Script\project.py", line 9, in
    from sharepoint import SharePoint
    File "C:\Users\co\OneDrive \Desktop\Files\Script\sharepoint.py", line 18, in
    config = json.load(config_file)
    File "C:\ProgramData\Anaconda3\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
    File "C:\ProgramData\Anaconda3\lib\json\__init__.py", line 357, in loads
    return _default_decoder.decode(s)
    File "C:\ProgramData\Anaconda3\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "C:\ProgramData\Anaconda3\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
    JSONDecodeError: Expecting value

    • @codingwithlu
      @codingwithlu  2 года назад

      Check your config.json file. Normally you get this error with a value is missing for a specific key.
      For example the json sample below is missing a value for the "user" key. Make sure you are not missing any values.
      {
      "share_pointr":
      {
      "user": ,
      "password": "{password}",
      "url": "{domain}.sharepoint.com",
      "site": "{domain}.sharepoint.com/sites/{Name}/",
      "doc_library": "Shared Documents/{Document}"
      }
      }

  • @mohandmahdi9495
    @mohandmahdi9495 4 года назад +1

    Hi,
    i would like to know how to upload files from salesforce to sharepoit kan you help me?

    • @codingwithlu
      @codingwithlu  4 года назад +1

      Will you be downloading the file first from Salesforce and then upload to SharePoint site? In Salesforce you can do a bulk download of files or access the file via url, but you will need to know the file id.

    • @mohandmahdi9495
      @mohandmahdi9495 4 года назад

      @@codingwithlu
      I want to create an upload button in salesforce which will directly save the files in sharepoint

    • @mohandmahdi9495
      @mohandmahdi9495 4 года назад

      @@codingwithlu and when i try to lanch the scrypt in the video i have this error
      drive.google.com/file/d/1EkJQH2B9NFurYcfhVmf8zUS7qPhVzZV9/view?usp=sharing

  • @douglasnunes4330
    @douglasnunes4330 2 года назад +1

    Hi Lu,
    You can help please ?
    Error authenticating against Office 365. Error from Office 365:', 'AADSTS50126: Error validating credentials due to invalid username or password.')

    • @codingwithlu
      @codingwithlu  2 года назад

      This error is a bit tricky to debug, because it can be your document name, url path, etc. I will be streaming live this Friday at 9pm CST, and I can look at you issue in more detail and debug in live stream if you like.

  • @neb542
    @neb542 3 года назад +1

    Can we do this with Javascript?

    • @codingwithlu
      @codingwithlu  2 года назад

      Yes this can be done in JavaScript because it's using the Microsoft API. Sure I can make a video and let you know when video has been uploaded

  • @renanandrade3693
    @renanandrade3693 Год назад

    thanksss!!!!!!

  • @vaibhavagrawal9059
    @vaibhavagrawal9059 3 года назад +1

    Hi ,
    I am able to access my sharepoint from the browser, but not from the above code that you have explained.
    I am getting the below exception, if someone could help me, that would be really helpful.
    Exception I am getting is :
    Exception: ('Error authenticating against Office 365. Error from Office 365:', "AADSTS50005: User tried to log in to a device from a platform (Unknown) that's currently not supported through Conditional Access policy. Supported device platforms are: iOS, Android, Mac, and Windows flavors.")

    • @codingwithlu
      @codingwithlu  3 года назад

      Hello Vaibhav,
      Are you using your personal Office 365 credentials or company credentials?
      This error message means that conditions have been applied when it comes to login into Office 365. These conditions are set in the Azure Admin Portal. Do you happen to know if any are set by your company?
      Also, which OS are you running your script on? it is showing in the error message that supported platforms are iOS, Android, Mac and Windows. Are you using Linux?

    • @vaibhavagrawal9059
      @vaibhavagrawal9059 3 года назад

      @@codingwithlu thanks for your reply.
      I am running this script in my company laptop only ans using Windows 10.
      I have also confirmed with my company there is no conditional access policy setup.
      I think this script will work if the user have only admin level access.
      Please guide me how to resolve this, I got badly got stuck here.

  • @sandyhanjaya3499
    @sandyhanjaya3499 2 года назад +1

    Hi, Lu! This was super helpful as I could effortlessly run this code last month. Unfortunately, this morning when I was attempting to rerun the code, I am having trouble getting through the following error:
    Exception: ('Error authenticating against Office 365. Error from Office 365:', "AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access ''.")
    Thanks in advance, Lu.

    • @codingwithlu
      @codingwithlu  2 года назад +1

      So in Office 365 your admin can add conditional access policies. The policy that your admin has added is that if you are in a specific location (maybe only in the office) you can login with 2FA, but if you are not within that location, 2FA is needed. You can ask you system admin if this is the case. They are changes your admin can make to allow you to login without 2FA, but that will be up to your admin

  • @Android_19
    @Android_19 Год назад

    Thanks

  • @yilu3219
    @yilu3219 2 года назад +1

    ImportError: cannot import name 'SharePoint' from 'sharepoint'?
    anyone ?

    • @codingwithlu
      @codingwithlu  2 года назад

      try changing the sharepoint.py name to something like sharepoint-api.py and when you import that class it will be something like "from sharepoint-api import SharePoint".
      See if this fixes the issue.

  • @alejandrocampos9453
    @alejandrocampos9453 Год назад

    What about renaming files

  • @miraj651
    @miraj651 3 года назад

    man do a video on 'on premises' please.

    • @codingwithlu
      @codingwithlu  3 года назад

      On premises it actual a bit more easier since you can just access SharePoint directory to upload docs.
      I will put in on my list of videos to make.

  • @chenlianghe
    @chenlianghe 2 года назад

    Almost! it is what it is... lol

  • @kharikrishna7508
    @kharikrishna7508 2 года назад

    SharePoint not available in package

  • @Nico-mi6bv
    @Nico-mi6bv 3 года назад +1

  • @ashwinireddypingali2994
    @ashwinireddypingali2994 3 года назад +2

    Hi Lu,
    Thanks, Very helpful.., Can you also make a video , that how can we download the files from share point , where the Microsoft share point is having
    multi factor authentication.

    • @codingwithlu
      @codingwithlu  3 года назад

      So for multi factor authentication, there is no was using SharePlum to connect to SharePoint. The work around would be to have the person that manages Azure Admin Center to see if they can create a new user that will be setup without MFA and then give that new user very specific access to SharePoint or other services.