Learn more about file upload and AJAX in Laravel 5 by reading our popular book: Laravel 5 Cookbook.

Learn how to create file upload with Laravel 4

File upload laravel

We discussed before form creation and validation but file upload input is a bit different. Let’s create our first file upload with laravel.

Before retrieving uploaded file data, We need to setup a simple form and two routes. The first route is for form view and the other route for form submission.

<!doctype html>
<html lang="en">
  <meta charset="UTF-8">
  {{ Form::open(array('url'=>'form-submit','files'=>true)) }}

  {{ Form::label('file','File',array('id'=>'','class'=>'')) }}
  {{ Form::file('file','',array('id'=>'','class'=>'')) }}
  <!-- submit buttons -->
  {{ Form::submit('Save') }}

  <!-- reset buttons -->
  {{ Form::reset('Reset') }}

  {{ Form::close() }}
Route::get('form', function(){
 return View::make('form');

Route::any('form-submit', function(){

Basically, Uploaded files aren’t stored in the $_GET or $_POST array but they stored in t