为了账号安全,请及时绑定邮箱和手机立即绑定

如何将文件从 Mayan EDMS 发送到外部 api?

如何将文件从 Mayan EDMS 发送到外部 api?

Helenr 2021-10-26 11:02:05
我还在学习 Django,还有很多我不知道的地方。问题是我无法将 .pdf(或任何其他格式)通过 ajax post 方法发送到外部 API。所以在接收端我只得到文件的字符串位置而不是实际文件。我已将以下 javascript 代码放在generic_list_items_subtemplate.html 中{% load i18n %}{% load static %}{% load common_tags %}{% load navigation_tags %}<div class="row">    <div class="col-xs-12">        <h4>            {% if page_obj %}                {% if page_obj.paginator.num_pages != 1 %}                    {% blocktrans with page_obj.start_index as start and page_obj.end_index as end and page_obj.paginator.object_list|length as total and page_obj.number as page_number and page_obj.paginator.num_pages as total_pages %}Total ({{ start }} - {{ end }} out of {{ total }}) (Page {{ page_number }} of {{ total_pages }}){% endblocktrans %}                {% else %}                    {% blocktrans with page_obj.paginator.object_list|length as total %}Total: {{ total }}{% endblocktrans %}                {% endif %}            {% else %}                {% blocktrans with object_list|length as total %}Total: {{ total }}{% endblocktrans %}            {% endif %}        </h4>        <hr>        <div class="well center-block">            <div class="clearfix">                <div class="pull-right">                    <form action="{% url 'common:multi_object_action_view' %}" class="form-multi-object-action" method="get">                        {% if object_list %}在接收方我得到name = "file"value = "/documents/12/preview/"但我想获取文件而不是这个字符串。我不知道如何定位文件以直接发送。
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 170 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号