UploadAttachment Functions
The UploadAttachment and UploadAttachmentSession functions upload a specified file to the specified attachment field in a specified table record. These two functions differ only in respect to parameters for login. For more information, see Login Parameters.
The uploaded files are copied into the standard Attachments folder unless you have specified a custom folder for Directories > Attachments directory in the Options window. The standard Attachments folder is in the installation directory on the application server. The directory path for this folder is C:\Program Files (x86)\PTC\Risk and Reliability Version\Windchill Risk and Reliability\Attachments.
Syntax
The following is the syntax for an HTTP request:
POST /WindchillRiskandReliability12.0/DataEngine.asmx/UploadAttachment HTTP/1.1
Host: HostName
Content-Type: application/x-www-form-urlencoded
Content-Length: length

UserName=string&Password=string&GroupName=string&ProjectName=string&SystemName=string&Table=string&Identifier=string&AdditionalIdentifier=string&AttachmentFieldName=string&AttachmentName=string
Parameters
In addition to login parameters, both the UploadAttachment and UploadAttachmentSession functions use these parameters:
ProjectName—The name of the Windchill Risk and Reliability Project. This value is case-sensitive.
SystemName—The name of the System file. This value is case-sensitive.
Table—The name of the Windchill Risk and Reliability table in which the record is located. This value is case-sensitive.
Identifier—The identifier of the record that you want to modify. This value is not case-sensitive.
AdditionalIdentifier—The second identifier of the record that you want to modify. This parameter is only required for the FMEA Worksheet table. For this table, you must specify the level of the FMEA data. This value is not case-sensitive. Depending on your FMEA data structure, the value can be one of the following: Item, Mode, Cause, Effect, or Action. If custom labels are assigned to data levels in the properties for the Project’s FMEA Design file, you can also use these values.
AttachmentFieldName—The name of the Attachments field to which you want to upload a file. This value is case-sensitive.
AttachmentName—The directory path and name of the file that you want to upload. The file must be accessible from the web server. For example, if you enter C:\temp\filename.txt, this file is uploaded if the following security restrictions are met:
The file exists in the specified location on the web server.
The web server process has permissions to files in this location.
You can also enter a UNC path to the file. The same security restrictions apply.
The following is an example of an HTTP POST request:
POST /WindchillRiskandReliability12.0/DataEngine.asmx/UploadAttachment HTTP/1.1
Host: test
Content-Type: application/x-www-form-urlencoded
Content-Length: length
UserName=Bill&Password=passwd&GroupName=Manager&ProjectName=Tablet PC &SystemName=Tablet PC&Table=System Tree Items&Identifier=System25 AttachmentFieldName=User Attachments 1&AttachmentName=C:\temp\flowchart.jpg
Returns
If the user is authenticated and the specified parameter values are found, the file is uploaded and ‘true’ is returned.
<?xml version="1.0" encoding="utf-8"?>
<DataEngineResponse xmlns="http://tempuri.org/">
<Success>true</Success>
</DataEngineResponse>
If the call fails, the AdditionalData tag provides the reason for the failure.