Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

script copying files to a network pla

  Asked By: Perry    Date: Nov 07    Category: Sharepoint    Views: 1701

script copying files to a network
pla (sharepoint: addressed to exclusive sender for this address)ce (doc
library)

That is not what I am asking.

A network place for a document library does not resolve to a unc (eg:
\\server\share\...) it is an actual web address (eg:
http://<server>/sites/<site name>/Shared%20Documents) that can be used
to populate the content store by way of the web server...

Any help would be appreciated...

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Nathanael Wong     Answered On: Nov 07

Does anyone know of a command or tool to use the Windows command
line
(or batch script) to copy files  to a network  place?

I have a directory structure that a want to periodically copy
into a
Sharepoint 2003 Document Library, and I do not want to have to
use drag
& drop each time...

 
Answer #2    Answered By: Todd Hamilton     Answered On: Nov 07

Following code might be helpful


Dim oDoc As New PKMCDO.KnowledgeDocument
Dim oFolder As New PKMCDO.KnowledgeFolder
Dim oWrkStream As ADODB.Stream
Dim sFileName As String 'Name of file to be uploaded
Dim sFullPath As String 'Full path to file to be uploaded
Dim sAuthor As String
Dim sTitle As String
Dim sDesc As String
Dim sParentFolder As String
Dim sDocFolder As String
Dim oVer As PKMCDO.KnowledgeVersion

sFileName = "FileName.pdf"
sFullPath = "D:\FileName.pdf"
sAuthor = "Shane - Author displayed in SPS"
sTitle = "Title displayed in SPS"
sDesc = "Description displayed in SPS"
sParentFolder = "http://ServerName/WorkspaceName/Documents/"
sDocFolder = "http://ServerName/WorkspaceName/Documents/Sales"

Set oWrkStream = oDoc.OpenStream
oWrkStream.Type = adTypeBinary
oWrkStream.SetEOS
oWrkStream.LoadFromFile sFullPath
oWrkStream.Flush
oDoc.Author = sAuthor
oDoc.Title = sTitle
oDoc.Description = sdescription
'oDoc.Keywords = Array("Keyword")
oFolder.DataSource.Open sParentFolder, , adModeReadWrite
oDoc.DataSource.SaveTo sDocFolder + "/" + sFileName, , ,
CreateOptions:=0

' Publish the document
Set oVer = New PKMCDO.KnowledgeVersion
oVer.Checkin oDoc
oVer.Publish oDoc
Set oDoc = Nothing
Set oVer = Nothing

 
Didn't find what you were looking for? Find more on script copying files to a network pla Or get search suggestion and latest updates.




Tagged: