I am working on integrating python and sha开发者_如何学JAVArepoint. I am facing major problems with the GetItems and CopyIntoItems web service calls present in the Copy web service.
The library i am using to consume the service is Python-suds .
I want to know if 1. Are these are the right methods to be used for downloading/uploading files from/to sharepoint ?
If yes - the way i am using them is like this - i) client.service.GetItems('Shared Documents/filename.doc') * I get a dictionray like structure that is something like this (reply){ GetItemResult = 0 } Obviously it is not returning any byte array stream - I am not sure what i am missing ii) I am not able to understand how to represent FieldInformationCollection and FieldInformation in Python and I am confused about how the method works in general with the different data types.
If the answer is no - Wow i have to start from scratch what is the best way of doing it with python - suds ( a working example shud be gr8 ! )
Look at
http://pypi.python.org/pypi/haufe.sharepoint
It provides a solid base for adding file operations.
As for downloading files, you can just use a standard HTTP GET for the file. If you look at the metadata that is returned, one of them will be an absolute url to the document. That will work fine over HTTP.
As for posting, there are many different solutions to this problem, but perhaps the simplest is just doing a HTTP PUT to your document library. Here is an example using C# but the principles will work with python's http libraries: Uploading files to Sharepoint (WSS 3.0) document library using HTTP PUT
精彩评论