![](/img/trans.png)
[英]Can Bearer token validate Message Extension request from MS Teams?
[英]Upload attachment from messages extension in MS Teams
为此,您必须使用具有 Web 视图的消息传递扩展并将其指向您自己的服务器。 据我所知,默认情况下你不能做你所要求的。
请参阅此处,“使用 Web 视图进行动态输入”一章
Web 视图显示您自己托管的网站,您可以在那里轻松实现文件上传。
截至目前,自适应卡中没有此类操作可用。 如果您想这样做,您需要创建一个网页并编写用于上传的自定义代码。 您可以使用:
<input type="file" id="attachment" ref={input => this.inputElement = input} style={{ display: "none" }} onChange={e => this.onFileChange(e)} />
请参阅此示例以了解有关基于操作的消息传递扩展 + 自定义网页的更多信息。
谢谢
没有通过自适应卡片Upload Documents
功能。
但建议触发web-view
,然后有上传功能。
消息扩展代码 (NodeJS):关于
Upload Documents
...
return {
task: {
type: 'continue',
value: {
height: 400,
width: 400,
title: 'Task module WebView',
url: `https://mywebsite.example.com`
}
}
};
在点击upload documents
,它会是这样的:
前端代码:
<div>
<input type="file" class="file-input" (change)="onFileSelected($event)" #fileUpload />
<div style="margin-left: -175px" class="centered">
<h2 style="color: #464775; font-weight: bold; margin-bottom: 10px; margin-top: -20px; margin-left: 30px">Add attachemnt to your task</h2>
<div *ngIf="!buttonDisable" style="margin-left: 70px; margin-bottom: 15px">
{{ uploadSuccess || 'No file uploaded yet.' }}
<button color="primary" style="margin-left: 10px" class="upload-btn" (click)="fileUpload.click()">
<i aria-hidden="true" class="fas fa-paperclip"></i>
</button>
</div>
<div style="margin-left: 65px" *ngIf="!buttonDisable">
<button color="primary" class="btn-cm" style="color: #3fb349; margin-left: 35px" (click)="onSubmit()">Submit Task</button>
</div>
<div *ngIf="buttonDisable" style="margin-left: 39px; margin-top: 30px">
<label style="color: #3fb349; margin-left: -1px; margin-top: 23px">{{ message }}</label>
<button color="primary" class="btn-cm" style="color: #3fb349" (click)="closeWindow()">Close</button>
</div>
</div>
</div>
丢弃内联css
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.