How do I upload a document to SharePoint with Java?

前端 未结 6 1973
余生分开走
余生分开走 2020-12-30 03:47

I\'m creating some big files (DB exports) with Java and I need to put them somewhere on our SharePoint server. Right now, I\'m doing this with IE but I\'d like to automate t

6条回答
  •  温柔的废话
    2020-12-30 03:51

    In addition to Sacha's suggestions, you can use the SharePoint SOAP web services. Each SharePoint site exposes a bunch of web services via the path http:///_vti_bin/.

    In your case, you probably want the Lists web service (http:///_vti_bin/Lists.asmx). You can grab the WSDL from http:///_vti_bin/Lists.asmx?WSDL. The WSS 3.0 SDK has details on how to use the web service (you'll probably want to use the UpdateListItems and AddAttachment methods).

    All that said, Sacha's first option (mapping a document library to a drive) is probably the easiest way assuming you can get around the NTLM issues.

    If you're using Windows you can simply navigate to a UNC path for a document library. For example, if the browser URL for your document library is:

    http:///Foo/BarDocs/Forms/AllItems.aspx

    you can simply type the corresponding UNC path in the Windows Explorer address bar:

    \\\Foo\BarDocs

    and then drag and drop files to this location. If you'd like you can map this location to a drive letter using Windows Explorer or the SUBST.EXE command-line utility.

提交回复
热议问题