ISharePointFileCollection.AddStream

Fore Syntax

AddStream(DestinationURL: String; FileName: String; Stream: IIOStream);

Fore.NET Syntax

None;

Parameters

DestinationURL. The relative path to the list, in which the file is available.

FileName. The name, by which the file is available in the shared access at the site.

Stream. The stream connected to the file that must be published at the site.

Description

The AddStream method adds a file to the site for shared access.

Example

Executing the example requires the SharePoint site located at: http://test-sharepoint.

Sub UserProc;
Var
    Site: ISharePointSite;
    Web: ISharePointWeb;
    FStream: IFileStream;
Begin
    Site := New SharePointSite.Create;
    Site.Url := "http://test-sharepoint";
    Site.UseDefaultCredentials := True;
    FStream := New FileStream.Create("c:\Work.Doc", FileOpenMode.ReadWrite, FileShare.DenyWrite);
    Web := Site.RootWeb;
    Web.Files.AddStream("Shared Documents""Work.Doc", FStream);
    Dispose FStream;
End Sub UserProc;

On executing the example the connection to the SharePoint site is executed. The selected file is published at the site for the shared access.

See also:

ISharePointFileCollection