I'm going insane, for enctype is set, everything is like I've always done it.
Here is the PHP:
$allowedExts = array("jpeg", "jpg", "JGP", "JPEG");
$temp = explode(".", $_FILES[$parsed['img']]["name"]);
$extension = end($temp);
print_r($_FILES);
if(is_uploaded_file($_FILES[$parsed['img']]["tmp_name"]) && $_FILES[$parsed['img']]["size"] < 200000 && ($_FILES[$parsed['img']]["type"] == "image/jpeg") || ($_FILES[$parsed['img']]["type"] == "image/jpg") && in_array($extension, $allowedExts)){
if ($_FILES[$parsed['img']]["error"] > 0){
echo "Error: " . $_FILES[$parsed['img']]["error"] . "<br>";
} else {
//echo "Upload: " . $_FILES[$parsed['img']]["name"] . "<br>";
//echo "Type: " . $_FILES[$parsed['img']]["type"] . "<br>";
//echo "Size: " . ($_FILES[$parsed['img']]["size"] / 1024) . " kB<br>";
//echo "Stored in: " . $_FILES[$parsed['img']]["tmp_name"];
if(file_exists("./" . $_FILES[$parsed['img']]["name"])){
echo $_FILES[$parsed['img']]["name"] . " already exists. ";
} else {
echo $_FILES[$parsed['img']]['tmp_name'];
move_uploaded_file($_FILES[$parsed['img']]["name"], "./" . $_FILES[$parsed['img']]["name"]);
}
}
} else {
echo "Invalid file";
}
Here is what print_r gives me:
Array
(
[0-image] => Array
(
[name] => p4pb9513672.jpg
[type] => image/jpeg
[tmp_name] => C:\xampp\tmp\php4D1C.tmp
[error] => 0
[size] => 141012
)
[1-image] => Array
(
[name] =>
[type] =>
[tmp_name] =>
[error] => 4
[size] => 0
)
[2-image] => Array
(
[name] =>
[type] =>
[tmp_name] =>
[error] => 4
[size] => 0
)
[3-image] => Array
(
[name] =>
[type] =>
[tmp_name] =>
[error] => 4
[size] => 0
)
[4-image] => Array
(
[name] =>
[type] =>
[tmp_name] =>
[error] => 4
[size] => 0
)
[5-image] => Array
(
[name] =>
[type] =>
[tmp_name] =>
[error] => 4
[size] => 0
)
[6-image] => Array
(
[name] =>
[type] =>
[tmp_name] =>
[error] => 4
[size] => 0
)
[7-image] => Array
(
[name] =>
[type] =>
[tmp_name] =>
[error] => 4
[size] => 0
)
)
$parsed['img'] contains '0-image', and echoing $_FILES[$parsed['img']]['tmp_name'] shows me the same tmp_name as the print_r, so it checks out.
Doesn't work, no errors, nothing, is_uploaded_file returns true.
Going insane.