SpiraPlan: ImportExport SOAP Web Service

See all operations

Document_AddFile

Description

Adds a new document (file) into the system and associates it with the provided artifact (optional) and project folder/type (optional)

Example(s)

            byte[] attachmentData = unicodeEncoding.GetBytes("Test Attachment Data To Be Stored");
            RemoteDocument remoteDocument = new RemoteDocument();
            remoteDocument.FilenameOrUrl = "test_data.xls";
            remoteDocument.Description = "Sample Test Case Attachment";
            remoteDocument.AuthorId = userId2;
            remoteDocument.ArtifactId = testCaseId1;
            remoteDocument.ArtifactTypeId = (int)DataModel.Artifact.ArtifactTypeEnum.TestCase;
            attachmentId1 = spiraImportExport.Document_AddFile(remoteDocument, attachmentData).AttachmentId.Value;
            

Parameters

Type Name Required
RemoteDocument? remoteDocument - The new document object (primary key will be empty)
base64Binary? binaryData - A byte-array containing the attachment itself in binary form

Return Value

RemoteDocument - The populated document object - including the primary key and default values for project attachment type and project folder if they were not specified