title: Error in Move function when upload file in laravel
body: <pre><code>foreach($messages as $singleMsg) {
      if ($uploadedFile) {
           $selectedMessageReply = MessageReply::where('msg_id', $singleMsg)-&gt;first();
           $selectedMessageReply-&gt;is_attachment = 1;
           $selectedMessageReply-&gt;save();
           $extension = $uploadedFile-&gt;getClientOriginalExtension();
           $uploadedFile-&gt;move($pathToFile.$singleMsg, $selectedMessageReply-&gt;id . '.' . $extension);
     }
  }
  </code></pre>
  
  <p>This code works file if without loop and work with single object but when I use this code inside loop , the <code>move</code> function gives <code>The file "app.zip" was not uploaded due to an unknown error.</code>, so What is the problem and how to fix it ?</p>