ReportingService2006.CreateResource Method

Definition

Adds a new resource to a SharePoint library.

public:
 ReportService2006::CatalogItem ^ CreateResource(System::String ^ Resource, System::String ^ Parent, bool Overwrite, cli::array <System::Byte> ^ Contents, System::String ^ MimeType, cli::array <ReportService2006::Property ^> ^ Properties);
public ReportService2006.CatalogItem CreateResource (string Resource, string Parent, bool Overwrite, byte[] Contents, string MimeType, ReportService2006.Property[] Properties);
member this.CreateResource : string * string * bool * byte[] * string * ReportService2006.Property[] -> ReportService2006.CatalogItem
Public Function CreateResource (Resource As String, Parent As String, Overwrite As Boolean, Contents As Byte(), MimeType As String, Properties As Property()) As CatalogItem

Parameters

Resource
String

The name of the new resource.

Parent
String

The fully qualified URL for the parent folder that will contain the resource.

Overwrite
Boolean

A Boolean expression that specifies whether to overwrite an existing resource with the same name and path. The default value is false.

Contents
Byte[]

The contents of the resource file.

MimeType
String

The MIME type of the resource. The maximum size is 260 characters.

Properties
Property[]

An array of Property objects that defines the property names and values to set for the resource.

Returns

A CatalogItem object for the newly created resource.

Remarks

The table below shows header and permissions information on this operation.

SOAP Headers (In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue
Required Permissions Creating a new resource: <xref:Microsoft.SharePoint.SPBasePermissions.AddListItems> on Parent

Updating an existing resource: <xref:Microsoft.SharePoint.SPBasePermissions.EditListItems> on Resource

The length of the Parent parameter cannot exceed 260 characters; otherwise, a SOAP exception is thrown with the error code rsItemLengthExceeded.

The Parent parameter cannot be null or empty or contain the following reserved characters: : ? ; @ & = + $ , \ * > < | . ". You can use the forward slash character (/) to separate items in the full path name of the folder, but you cannot use it at the end of the folder name.

If errors occur, the resource is not created.

Adding a resource to a SharePoint library modifies the ModifiedBy and ModifiedDate properties of the parent folder.

Applies to