title: XAMPP-File upload error
body: <p>I used a form to upload a image file(about 200k). And moved it to a specified folder in back-end. But when I have open this file in this folder,it's not a image file,its size were just 45 bytes. And I try edit it,the file contents were "XAMPP/xamppfile/temp/phpdBLLad" instead of binary code. Just save a ['tmp_name'] in my file.</p>
  
  <p>front-end:  </p>
  
  <pre><code>&lt;form action="/photos" method = "POST" enctype="multipart/form-data"&gt;
  
      &lt;div class = 'col-md-12 red_line2' style = "height:40px;width:30%; color:black"&gt;
  
          &lt;input type="hidden" name="_token" value="{{{ csrf_token() }}}" /&gt;
          &lt;input type = "hidden" name = 'album_id' value = '{{$album-&gt;id}}'&gt;
          &lt;input id = 'addimg' name = 'myimage' type="file" multiple style="display:none" /&gt;
          &lt;button type = 'button' id = 'fileUpload' class="btn btn-link btn-lg"  data-target="#image_preview" aria-expanded="false" aria-controls="collapseExample"&gt;
              &lt;span class="fa fa-camera"&gt;&lt;/span&gt;
          &lt;/button&gt;
          &lt;button type="button" class="btn btn-link btn-lg" &gt;
              &lt;span class="fa fa-trash"&gt;&lt;/span&gt;
          &lt;/button&gt;
          &lt;button type="button" class="btn btn-link btn-lg" &gt;
              &lt;span class="fa fa-pencil-square-o"&gt;&lt;/span&gt;
          &lt;/button&gt;
  
      &lt;/div&gt;
      &lt;div class = 'col-md-12'&gt;
          &lt;div class = "extraspace-small"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class = 'col-md-12'&gt;
          &lt;div class = "collapse" id = "image_preview"&gt;
          &lt;div class = 'pull-right myfloater'&gt;
              &lt;button id = "upload" type = "submit" class="btn btn-sm btn-primary vcenter"&gt;
                  UPLOAD
              &lt;/button&gt;
              &lt;button id = "cancle_upload" type = "button" class="btn btn-sm btn-danger vcenter"&gt;
                  CANCLE
              &lt;/button&gt;
          &lt;/div&gt;
          &lt;div class = "well mywell" id = 'preview_container'&gt;
          &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>back-end:        </p>
  
  <pre><code>    public function store(Request $request)
  {
      $rules = array(
        'album_id'=&gt;'required',
        'myimage'=&gt;'required|image'
      );        
  
      $validator = Validator::make($request-&gt;all(), $rules);        
  
      if($validator-&gt;fails()){
          var_dump($validator-&gt;errors());
      }
  
      $data = $request-&gt;only('album_id','myimage');
      $destinationPath = 'albums/';
      $file = $request-&gt;file('myimage');
      $filename = $file-&gt;getClientOriginalName();
      Storage::put($destinationPath.$filename, $data['myimage']);
      $album = Images::create(array(
        'image' =&gt; $filename,
        'album_id' =&gt; $request-&gt;album_id,
      ));
  
      return redirect('photos/'.$request-&gt;album_id);//,['id'=&gt;$album-&gt;id]
  }
  </code></pre>