PHP expert |
|
Hallo,
Ik ben bezig met een avatar upload scriptje
alleen krijg ik deze error:
Warning: Unable to create './avatars/': Permission denied in c:\apache\htdocs\toplinesource\leden\configuratiescherm.php on line 111
Warning: Unable to create './avatars/': Permission denied in c:\apache\htdocs\toplinesource\leden\configuratiescherm.php on line 111
Warning: Unable to move 'C:\WINDOWS\php45B.tmp' to './avatars/' in c:\apache\htdocs\toplinesource\leden\configuratiescherm.php on line 111
Warning: Unable to move 'C:\WINDOWS\php45B.tmp' to './avatars/' in c:\apache\htdocs\toplinesource\leden\configuratiescherm.php on line 111
Waarbij deze code hoord:
<?php
if($_FILES['avatar']['type'] == "image/gif" || $_FILES['avatar']['type'] == "image/png" || $_FILES['avatar']['type'] == "image/jpg")
{
if(empty($_POST['naam']))
{
$sName = $_FILES['avatar']['name'];
}
else
{
$sExtension = strrchr($_FILES['avatar']['name'], ".");
$sName = $_POST['avatar'] . $sExtension;
}
move_uploaded_file($_FILES['avatar']['tmp_name'], "./avatars/".$sName); // regel 111
chmod("./avatars/".$sName, 0777);
}
?>
<?php if($_FILES['avatar']['type'] == "image/gif" || $_FILES['avatar']['type'] == "image/png" || $_FILES['avatar']['type'] == "image/jpg") { if(empty($_POST['naam'])) { $sName = $_FILES['avatar']['name']; } else { $sExtension = strrchr($_FILES['avatar']['name'], "."); $sName = $_POST['avatar'] . $sExtension; } chmod("./avatars/".$sName, 0777); } ?>
Nu weet ik dat dit komt omdat ik het op mijn localhost doe, maar hoe kan ik dit oplossen?
Ik heb et al opgelost, :$
Et was omdat ik $_FILES['bestand'] ipv $_FILES['avatar'] had gebruikt. Maar bedankt voor de genomen moeite!:)
|