Twilio MMS Send Local File

血红的双手。 提交于 2019-11-29 08:59:01

Rajendra, hello! Megan from Twilio here.

This sounds similar to what I ran into building an OpenCV MMS implementation in this blog post.

The example there is in Python specifically, after writing an image to my local filesystem and making the desired modifications on it, I send it through:

@app.route('/uploads/<filename>', methods=['GET', 'POST'])
def uploaded_file(filename):
    return send_from_directory(UPLOAD_FOLDER,
                               filename)

which handles the delivery of the following TwiML:

 message.media('http://YourNgrokURL/uploads/{}'.format(filename))

You'll be needing the equivalent of Flask's send_from_directory to handle this in your implementation.

Hope this helps!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!