如何使用Bot Framework和NodeJS上传文件时限制文件大小限制?

时间:2017-05-09 14:33:52

标签: bots botframework

有人知道如何设置Microsoft Bot Framework上Dialog上传的图像/文件的最大文件大小?

提前致谢! :)

1 个答案:

答案 0 :(得分:0)

不是针对NodeJ,而是针对C#情况

import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import pandas as pd

df=pd.read_excel("https://github.com/chris1610/pbpython/
blob/master/data/salesfunnel.xlsx?raw=True")

pv = pd.pivot_table(df, index=['Name'], columns=["Status"], values= 
['Quantity'], aggfunc=sum, fill_value=0)

trace1 = go.Bar(x=pv.index, y=pv[('Quantity', 'declined')], name='Declined')
trace2 = go.Bar(x=pv.index, y=pv[('Quantity', 'pending')], name='Pending')
trace3 = go.Bar(x=pv.index, y=pv[('Quantity', 'presented')], name='Presented')
trace4 = go.Bar(x=pv.index, y=pv[('Quantity', 'won')], name='Won')

app = dash.Dash()

app.layout = html.Div(children=[
html.H1(children='Sales Funnel Report'),
html.Div(children='''National Sales Funnel Report.'''),
dcc.Graph(
    id='example-graph',
    figure={
        'data': [trace1, trace2, trace3, trace4],
        'layout':
        go.Layout(title='Order Status by Customer', barmode='stack')
    })
])

对于NodeJ,也许您应该使用using (var http = new HttpClient()) { var file = (response as AwaitableAttachment).Attachment; var file_content = await http.GetAsync(file.ContentUrl); var contentLenghtBytes = file_content.Content.Headers.ContentLength; var contentLengthMegabytes = (contentLenghtBytes / 1024f) / 1024f; return result; } 方法