0

I need to copy a file from local server to SP library. That being said I've the below batch code which works well with my local folders, but when the link is replaced with sharepoint it doesn't copy.

pushd D:\test1
>nul Robocopy  /Maxage:1 D:\test2
popd

I appreciate if I could get a solution similar to the above script, as I need to copy a file that is created today.

1

You will not be able to copy a file directly from disk into SP2007. Starting from SP2010 and up there are WebDav extensions that allow you to open a document library as a file folder but IIRC they do not exist in MOSS.

To copy a file, you will need to use web services (copy.asmx). See for example: http://oricode.wordpress.com/2008/07/03/upload-a-file-to-sharepoint-2007-using-webservices-with-a-specific-content-type/ or http://geek.hubkey.com/2007/10/upload-file-to-sharepoint-document.html

Or, you can use one of the many 3rd-party tools that will give you a nice GUI to upload files from a disk folder. For example, Sharegate (Disclaimer: I work for Sharegate's parent company)

0

would stsadm -import work for you?

stsadm -o import

-url

-filename

[-includeusersecurity]

[-haltonwarning]

[-haltonfatalerror]

[-nologfile]

[-updateversions] <1-3>

[-nofilecompression]

[-quiet]

http://technet.microsoft.com/en-us/library/cc261866(v=office.12).aspx

  • This is to import content migration packages, not single files – Louis Mar 11 '14 at 2:47

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.