Пример формы для загрузки файла.

title = "Form Example 1"
url = "/form-example-1"
layout = "default"
description = ""
hidden = "0"
==
function onAnketForm() {
  $path  = \Config::get( 'filesystems.disks.local.root' ) . '/ankets/'; 
  $x   = \Request::file( 'file' ); 

  if ( $x ) { 
   $ext  = $x->getClientOriginalExtension(); 
   $file_name = $this->hash() . '.' . $ext; 
   $x->move( $path, $file_name ); 

   $vars = [ 
    'file_name' => $file_name, 
    'path'  => $_SERVER[ 'HTTP_ORIGIN' ] . '/storage/app/ankets/', 
    'lang' => $lang, 
   ]; 
  }
}
==
 {{ form_open({ id: 'order_form', files: true }) }} 
    <div id="anket"> 
     <div class="item"><input type="text" name="name" value="" placeholder="Ваше имя"></div> 
     <div class="item"><input type="file" name="file" /></div> 
     <div id="item_result"></div> 
     <div class="item"><input type="submit" value="Отправить"></div> 
    </div> 
 {{ form_close() }}

<script>
var form = document.getElementById( 'order_form' );
if ( form ){
 form.addEventListener( 'submit', function ( event ) {
  event.preventDefault();
  this.ajaxRequest( form );
  document.getElementById( 'item_result' ).textContent = 'Минуту';
 }.bind( this ) );
}

function ajaxRequest ( form ) {
 var handler  = 'onAnketForm',
  formdata = new FormData( form );

 $.ajax({
  headers : {
   'X-OCTOBER-REQUEST-HANDLER' : handler,
  },
  type  : 'post',
  cache  : false,
  contentType : false,
  processData : false,
  data  : formdata,
  success  : function( data ) {
   document.getElementById( 'item_result' ).textContent = data.result;
  }
 });
}
</script>