title: laravel file upload throws an error "file does not exist or is not readable."
body: <p>I'm trying to upload an image to <code>images</code> folder.</p>
  
  <pre><code>if ($request-&gt;hasFile('pic')) {
              $file = $request-&gt;file('pic');
              $file_name = time() . '.' . $file-&gt;getClientOriginalExtension();
              $destinationPath = public_path('/images/');
              $file-&gt;move($destinationPath, $file_name);
              $model-&gt;pic= $file_name;
          }
  
  </code></pre>
  
  <p>But i get this error : </p>
  
  <blockquote>
    <p>The "./././php4E16.tmp" file does not exist or is not readable.</p>
  </blockquote>
  
  <p>I'm uploading a photo for a post in other controller with same code and its working fine.</p>
  
  <p>I can't figure out what's wrong .</p>
  
  <p>I'm not trying to upload large size images or somthing.</p>
  
  <p>although the php.ini is edited to accept large files .</p>
  
  <p>what I have tried :</p>
  
  <ol>
  <li>clearing the <code>cache</code>.</li>
  <li>clearing the <code>config cache</code>.</li>
  <li>updated Laravel version from <code>6.3</code> to <code>6.4</code>.</li>
  <li>added <code>enctype="multipart/form-data"</code> to form.</li>
  </ol>
  
  <p>nothing works :\</p>
  
  <p>I'm not sure whats happening here but the first time i tried to upload it worked but now its not working !</p>
  
  <p>Any idea what's wrong here?</p>