Hi!
I do not understand what is going on here. I upload a few files from an HTML form (no php) and the action is to a page upload.php
This is upload.php
PHP Code:
<?php
const ICON_UNZIP_DIR = 'C:/Temp/icons/';
echo "<pre>";print_r($_FILES);echo "</pre>";
$filesTotal = count($_FILES['upload']['name']);
echo "filesTotal = $filesTotal<br/>";
for ($f=0;$f<$filesTotal;$f++) {
echo "tmp_name = " . pathinfo($_FILES['upload']['tmp_name'][$f],PATHINFO_BASENAME) . "<br/>";
echo "destination = " . ICON_UNZIP_DIR . $_FILES['upload']['name'][$f] . "<br/>";
if (move_uploaded_file(pathinfo($_FILES['upload']['tmp_name'][$f],PATHINFO_BASENAME),ICON_UNZIP_DIR . $_FILES['upload']['name'][$f])) {
echo "File uploaded successfully!<br/>";
} else {
echo "File did not upload!<br/>";
}
}
?>
Sorry for the echo's but I'm trying to see what is going on which is a whole lot of nothing! :(
What I see in the browser is this
Code:
Array
(
[upload] => Array
(
[name] => Array
(
[0] => Magme 3.4.apk
[1] => MI UI 9 - Icon Pack 1.3.5.apk
)
[type] => Array
(
[0] => application/octet-stream
[1] => application/octet-stream
)
[tmp_name] => Array
(
[0] => C:xampptmpphp3C76.tmp
[1] => C:xampptmpphp3D71.tmp
)
[error] => Array
(
[0] => 0
[1] => 0
)
[size] => Array
(
[0] => 11868020
[1] => 16803580
)
)
)
filesTotal = 2
tmp_name = php3C76.tmp
destination = C:/Temp/icons/Magme 3.4.apk
File did not upload!
tmp_name = php3D71.tmp
destination = C:/Temp/icons/MI UI 9 - Icon Pack 1.3.5.apk
File did not upload!
Yes C:Tempicons does exist and it is case perfect as well. Dying to know what my newbie mistake is! =
Thanks for the nudge or if need be a hammer over the head!
Dave
CodingForums...
ما را در سایت CodingForums دنبال می کنید
برچسب : نویسنده : codingforums بازدید : 181 تاريخ : پنجشنبه 30 شهريور 1396 ساعت: 17:45