It's all about the answers!

Ask a question

RQM: can not upload data (byte arr) as an attachment via Rest-Api


Dani Simon (70114) | asked Sep 02 '19, 10:54 a.m.
edited Sep 03 '19, 3:59 a.m.

 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")

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



permanent link
Subhajit Bhuiya (6222) | answered Nov 22 '19, 2:35 a.m.
JAZZ DEVELOPER

 Can you please provide the code for both the function. File as well as byte


permanent link
smith machinist (9) | answered Nov 22 '19, 5:28 a.m.

 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


Register or to post 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.