Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

not able to upload image by using visualstudio api-version=1.0-preview.2 API

$
0
0

URL : http://XXX.visualstudio.com//DefaultCollection/_apis/wit/attachments?fileName=abc.png&api-version=1.0-preview.2

Method is post

Header  that i pass

Content-Type application/json

in body

image byte is converted into base64 and pass this in body.

Response ::

{"id":"8a68d45b-8a48-4f09-b2b1-204dae830b50","url":"https://XXX.visualstudio.com/DefaultCollection/_apis/wit/attachments/8a68d45b-8a48-4f09-b2b1-204dae830b50?fileName=abc.png"}

After that when i download file from

https://XXX.visualstudio.com/DefaultCollection/_apis/wit/attachments/8a68d45b-8a48-4f09-b2b1-204dae830b50?fileName=abc.png

its not open it in my PC.

How visualstudio.com know that data is in base64 or plain?

As API http://www.visualstudio.com/en-us/integrate/reference/reference-vso-work-item-attachments-vsi#Uploadanattachment says that If file is binary then use a Base64 encoded string.


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>