Save a file from an array () in laravel

0

I have the following result of a request for a view:


array:10 [▼
  "_token" => "safbCVoGYiCk4cpDPJmSCZDJF17YkgAg21DwT7Iu"
  "tipopersona" => "2"
  "empresa" => "3"
  "persona" => "3"
  "tsolicitud" => "1"
  "comentario" => "Esto es un Comentario de Esta Solicitud"
  "carta_ministro" => UploadedFile {#601 ▶}
  5 => array:1 [▼
    0 => UploadedFile {#603 ▶}
  ]
  6 => array:1 [▶]
  7 => array:1 [▶]
]

I need to save the last 3 arrays as attachments (file(array)->store('public')) I do not know if it's that way. I do not know in what way I could do it, this request is received in a controller. These arrays are attachments that are loaded from the view.

    
asked by Luis Medina 05.05.2018 в 02:25
source

1 answer

0

I already solved it, in the ajax where I was loading the files I was going to upload, change the name to a text data:

$('#doc_solicitud').append('<tr><td>'+docObj.documento_solicitud+'</td><td><input class="btn btn-default" type="file" name="doc'+docObj.id+'" id="doc'+docObj.id+'" required="true"></td></td></tr>');
    
answered by 05.05.2018 в 02:37