Jump to content
php.lv forumi

Uploadot png un jpeg bildes


Jackal

Recommended Posts

Nu nekādīgi nesanāk šito skriptu uzrakstīt pareizi. Kas šajā skriptā ir nepareizi? Nekādus errorus nerāda vienkārši parāda, ka neizdevās uploadot failu

 

if($_SERVER['REQUEST_METHOD'] =='POST'){

foreach ($_FILES["pictures"]["error"] as $key => $error) {

if ($error == UPLOAD_ERR_OK) {

$tmp_name = $_FILES["pictures"]["tmp_name"][$key];

$name = $_FILES["pictures"]["name"][$key];

if ($_FILES['pictures']['type']=="pictures/jpeg" || $_FILES['pictures']['type']=="pictures/png"){

move_uploaded_file($tmp_name, "C:\Web Page\EasyPHP1-8\www\bitbucket/$name");

echo "File ".$name." have been uploaded successfully";

echo '<br>Your file is here <a href="bitbucket.php?id='.$name.'">';

echo "/bitbucket/".$name.'</a>';

} else {

echo "neizdevâs";

}

}

}

}

Edited by Jackal
Link to comment
Share on other sites

×
×
  • Create New...