foreach($messages as $singleMsg) {
if ($uploadedFile) {
$selectedMessageReply = MessageReply::where('msg_id', $singleMsg)->first();
$selectedMessageReply->is_attachment = 1;
$selectedMessageReply->save();
$extension = $uploadedFile->getClientOriginalExtension();
$uploadedFile->move($pathToFile.$singleMsg, $selectedMessageReply->id . '.' . $extension);
}
}
This code works file if without loop and work with single object but when I use this code inside loop , the move
function gives The file "app.zip" was not uploaded due to an unknown error.
, so What is the problem and how to fix it ?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire