檔案上傳組件使用。

來源:互聯網
上載者:User

標籤:end   document   text   files   src   index   tps   asi   show   

參考:
https://www.cnblogs.com/landeanfen/p/5007400.html

bootstrap-fileinput源碼:https://github.com/kartik-v/bootstrap-fileinput

bootstrap-fileinput線上API:http://plugins.krajee.com/file-input

bootstrap-fileinput Demo展示:http://plugins.krajee.com/file-basic-usage-demo

<script src="/static/vendors/kartik-v-bootstrap-fileinput-3540936/js/plugins/piexif.min.js"        type="text/javascript"></script><script src="/static/vendors/kartik-v-bootstrap-fileinput-3540936/js/plugins/sortable.min.js"        type="text/javascript"></script><script src="/static/vendors/kartik-v-bootstrap-fileinput-3540936/js/plugins/purify.min.js"        type="text/javascript"></script><script type="text/javascript" src="/static/vendors/kartik-v-bootstrap-fileinput-3540936/js/fileinput.min.js"></script>
 <form id="fileuploadform" enctype="multipart/form-data">                                <div class="col-md-12 col-sm-12 col-xs-12 form-group has-feedback">                                    <label class="control-label col-md-3 col-sm-12 col-xs-12"                                    >選擇檔案</label>                                    <div class="col-md-9 col-sm-12 col-xs-12">                                        <input id="input-id" type="file">                                    </div>                                </div>
$(document).ready(function () {    $("#input-id").fileinput({        showUpload:true,        uploadLabel: "xxx",        uploadTitle: "xxxx",        allowedFileExtensions: [‘xlsx‘],        maxFileSize: 10000,        maxFilesNum: 1,        uploadUrl:  "xxxx",        //showPreview:false,        enctype: ‘multipart/form-data‘,        ajaxSettings: { type: "POST",   headers: header,},        uploadExtraData: function (previewId, index) {            var obj = {};           obj["xxx"]=$("#xxx").val()            return obj;        },     });    });
 perfFile = request.FILES.get("file_data", None)  # 擷取上傳的檔案,如果沒有檔案,則預設為None    if not perfFile:        result["error"] = "no uploaded files found"        return Response(result)

檔案上傳組件使用。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.