Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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


0 votes



2 answers

Permanent link

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

0 votes


Permanent link

 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.

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 480

Question asked: Sep 02 '19, 10:54 a.m.

Question was seen: 2,297 times

Last updated: Nov 22 '19, 5:28 a.m.

Related questions
Confirmation Cancel Confirm