RQM: can not upload data (byte arr) as an attachment via Rest-Api
Hi all
I try to upload a file as a byte array to rqm attachment.
I am using c# System.Net.WebClient public byte[] UploadData(Uri address, string method, byte[] data):
I add the Content-type to my client before:
client.Headers.Add("Content-Type", "multipart/form-data; boundary=---------------------8d72fa8719bd91f")
var b = client.UploadData(new Uri("https://server/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/projArea/attachment"), "POST", fileInBytes);
I get an empty byte array back and the location url for the posted file is "not found".
If I remove the Content-Type, I got a Protocol-Error. The same without the boundary.
While using method to post the file, which is saved locally (no byte array), it works with any problem:
public byte[] UploadFile(Uri address, string method, string fileName);
But in this case I don't want to save the file temporary to the system due to access rights on the machine, but post the byte array which contains the file to rqm.
I already checked the byte array and it contains correct data.
Thanks for any help and ideas,
dani
|
2 answers
Can you please provide the code for both the function. File as well as byte |
I’m extremely affected regarding the information you offer in your articles. i need to say am extremely overpowered by your whole story. It’s tasking to induce such quality data on-line these days. I expect to staying here for an extended time. |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.