VSO REST API:无法在附加到的工作项中打开上载的二进制附件 [英] VSO REST API: Uploaded binary attachment cannot be opened in work item it is attached to

查看:46
本文介绍了VSO REST API:无法在附加到的工作项中打开上载的二进制附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说明......

https://www.visualstudio.com/integrate/api/wit/attachments#Uploadanattachment

https://www.visualstudio.com/integrate/api/wit/attachments#Uploadanattachment

...说上传BINARY附件时,Base64对文件进行编码并使其成为REST调用(POST)的主体。 没问题。 上传成功。 

... say when uploading a BINARY attachment, to Base64 Encode the file and make it the body of the REST call (POST).  No problem.  Upload succeeds. 

然后我继续使用...将其附加到现有工作项...

I then proceed to attach it to an existing work item using ...

https://www.visualstudio.com / integrate / api / wit / work-items #UpdupworkitemsAddanattachment

https://www.visualstudio.com/integrate/api/wit/work-items#UpdateworkitemsAddanattachment

...再次成功。 然后我可以进入VSO(通过浏览器)并找到上面已更改的工作项。 它列出了附件。 但是,当我尝试打开附件时,我得到的只是一个带有小X的浏览器窗口 - 意思是
当然附件无法打开。

... Again, success.  I can then go into VSO (via browser) and find the work item that has been changed above.  It lists the attachment.  However, when I try to open the attachment, all I get is a browser window with a small X -- meaning of course the attachment failed to open.

好的,让我们看看在本地下载附件并查看其中的内容。 

OK, let's download the attachment locally and take a look at what's inside. 

在Notepad ++中打开文档,只找到我上传文件时发送的Base64字符串。 这是预期的行为,还是我在上传时遗漏了什么? 关于这个主题,API文档非常稀疏。

Open the document in Notepad++ and find nothing but the Base64 string I sent when I uploaded the file.  Is this the expected behavior, or is there something I'm missing on the upload?  The API docs are pretty sparse on the subject.

使用直接文本文件(UTF8编码)再次尝试整个过程,再次按照API文档工作正常。

Trying this whole process again with a straight up text file (UTF8 encoding), and again following the API docs works just fine.

推荐答案

问候,

我认为它应该在IE浏览器中打开;我不确定为什么不开放。我建议您进行交叉检查,如果您在上传时已包含
所有内容,请告知我们反馈。我们很乐意为您提供更多信息。

问候,


这篇关于VSO REST API:无法在附加到的工作项中打开上载的二进制附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆