Can anyone see why my upload would be failing? It’s hitting my “else” statement.
$target_dir = "../uploads/";
$target_file = $target_dir . basename($_FILES["articleFile"]["name"]);
if(move_uploaded_file($_FILES["articleFile"]["name"], $target_file))
{
echo "<div class=\"disclaimer\"><span>Congratulations</span>The file ". basename( $_FILES['articleFile']['name']). " has been uploaded</div>";
}
else
{
echo "<div class=\"error\"><span>Error</span>There was an problem uploading the file, please try again!</div>";
}
Echoing $target_file outputs “…/uploads/” so I think it’s something wrong with the move function? Can anyone spot what I’m doing wrong? I had it working but my brain is failing me. I must be missing something obvious. I had it working not too long ago…