0
Hello I need to upload files via ajax, where each event of clicking the input file, I already upload the corresponding file. I do not know how to do this dynastically, since what changes between a field and another is the name. It is how not to repeat the variables for each input name
Javascript file
  $('#btnEnviar').click(function () {
                 $.ajax({
                     url: upload.php, 
                     data: form,
                     processData: false,
                     contentType: false,
                     type: 'POST',
                     success: function (data) {
                         alert(data);
                     }
                 });
             });    
HTML file
<div class="panel-body">
    Foto 3x4
    <br />
    <input type="file" name="foto3x4" class="btn btn-primary btn-xs" value="Upload">
</div>
<div class="panel-body">
    Foto 16x9
    <br />
    <input type="file" name="foto16x9" class="btn btn-primary btn-xs" value="Upload">
</div>
						
In the case of type are files, but how to identify which file is related to foto16x9 and which is related to foto3x4?
– tkmtts
Then in this case I believe that you will have to have a field for each photo even...
– Will Knippelberg