Angularjs $http post file and form data

后端 未结 8 1150
广开言路
广开言路 2020-11-28 22:14

I have the below request in python

import requests, json, io

cookie = {}
payload = {\"Name\":\"abc\"}
url = \"/test\"
file = \"out/test.json\"

fi = {\'file         


        
8条回答
  •  情书的邮戳
    2020-11-28 23:13

    You can also upload using HTML5. You can use this AJAX uploader.

    The JS code is basically:

      $scope.doPhotoUpload = function () {
        // ..
        var myUploader = new uploader(document.getElementById('file_upload_element_id'), options);
        myUploader.send();
        // ..
      }
    

    Which reads from an HTML input element

    
    

提交回复
热议问题