I am trying to get the file size of an image and I keep getting Warning: filesize(): stat failed for img.jpg
This is what I did:
['name'] in the $_FILES array is the name of the file on the CLIENT machine. It is information only, and has absolutely no relevance to what's actually stored on your server. You need to look at ['tmp_name'], which is where PHP has stored the file temporarily on the server, after the upload completed:
$path = $_FILES['profile']['tmp_name'];
^^^^^^^^^^^^