title: laravel 5.4 upload image
body: <p>My controller code for upload file in laravel 5.4:</p>
  
  <pre><code>if ($request-&gt;hasFile('input_img')) {
      if($request-&gt;file('input_img')-&gt;isValid()) {
          try {
              $file = $request-&gt;file('input_img');
              $name = rand(11111, 99999) . '.' . $file-&gt;getClientOriginalExtension();
              $request-&gt;file('input_img')-&gt;move("fotoupload", $name);
          } catch (Illuminate\Filesystem\FileNotFoundException $e) {
  
          }
      }
  }
  </code></pre>
  
  <p>Image was successfully uploaded but the code threw an exception :</p>
  
  <blockquote>
    <p>FileNotFoundException in MimeTypeGuesser.php line 123</p>
  </blockquote>
  
  <p>The file is there any fault in my code or is it a bug  in laravel 5.4, can anyone help me solve the problem ?</p>
  
  <p>My view code:</p>
  
  <pre><code>&lt;form enctype="multipart/form-data" method="post" action="{{url('admin/post/insert')}}"&gt;
      {{ csrf_field() }}
      &lt;div class="form-group"&gt;
          &lt;label for="imageInput"&gt;File input&lt;/label&gt;
          &lt;input data-preview="#preview" name="input_img" type="file" id="imageInput"&gt;
          &lt;img class="col-sm-6" id="preview"  src=""&gt;
          &lt;p class="help-block"&gt;Example block-level help text here.&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;label for=""&gt;submit&lt;/label&gt;
          &lt;input class="form-control" type="submit"&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>