how to make angular "receive" or pull an html file, and from angular to python?

0

In a form of an HTML page with the tag input typye="file", in which you can select a file, this file is sent by email in automatic ..

in my project I pull the data to angular and later by means of post I send it to python to send mail from python.

I hope you can not help step by step, please.

HTML - > where is the button to load or select the file.

<form enctype="multipart/form-data">
  <div ng_show="ticketActivo.carga" style="margin-left: 70px;">
     <input type="file" name="archivos" value="Mouse"><br>
  </div>

ANGULAR - > function with which I send the data to the specified path, $ scope.ticketActive is the "variable" or object that stores all the values of the other fields of the form (name, age, etc.)

$scope.actualizaStatusTicket = function () {
            var ruta = '/atn/tickets_web/api/ticket/actualiza/?var1=34';
            $http.post(ruta, $scope.ticketActivo).success(function(data){
            });

    };

PYTHON - > Here is how I receive the ticketActive object, and I get the data to manipulate them.

@csrf_exempt
def actualiza_ticket(request):
    conexion = conexion_db()
    objeto = dict(request.POST.dict())

How can I make the step or send this file previously selected in html, I'm waiting for your help?

    
asked by Jonathan Garcia 29.08.2018 в 21:28
source

0 answers