1

Looking for a way to automagically add files to a sharepoint document library. We have a process that runs and produces a file (Java process). We would like to either add the file directly to Sharepoint or schedule a task that picks up files and puts them in Sharepoint. So a Java or vb/batch/powershell solution would be the best fit.

3

You can directly call the SharePoint APIs through Powershell. Here are some links to help out:

http://sharepoint.microsoft.com/blogs/zach/Lists/Posts/Post.aspx?ID=7 http://wiki.threewill.com/display/enterprise/Add+Files+to+a+SharePoint+Document+Library+using+PowerShell http://pshell.info/sharepoint/166/uploading-documents-to-sharepoint/

2
  • Great links - I stumbled upon a simple, free utility that takes care of this for us. – Jibba Aug 20 '09 at 22:45
  • The 3 links are not working anymore. – RealHowTo Feb 19 '14 at 22:03
2

Here's an MSDN article describing an ASP.NET approach to this, which you could possibly modify for your situation:

http://msdn.microsoft.com/en-us/library/dd902097.aspx

2

Not a scripting solution but we have a Delphi Application that needed to do this. Since Document Libraries can be accessed via Explorer as UNC shares we simply just copy the files directly into the Document Library. You can also map a drive to the library if needed.

The Delphi application uses normal Windows File Copy commands to transfer the files.

1
  • I was hoping that it would be that simple, but couldn't get a drive mapped or file copy to UNC. Researched and it seems that it works for some and not for others. Probably something in the way the site is setup. – Jibba Aug 20 '09 at 22:22
1

davcopy works great.. but I had to first set the title column to be an optional field in the upload destination library for it to show up (otherwise it was checked out and folk could not see it) see: http://www.codeproject.com/KB/sharepoint/Removing_Title_column.aspx but set it to optional instead of hidden

0

In the interest of keeping things dead simple, we are going with DavCopy. This lets us run our process, and then run a simple batch script to copy the files to SharePoint. It also produces a nice output report for the copy process.
Syntax: DavCopy.exe * http://www.myserver.com/myFolder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.