Bonjour,
Je n'arrive pas à charger un fichier avec la fonction Copy. Apparement le problème vient du chemin mais j'ai un peu tout essayer et ça me fait toujours cette erreur :
Warning: copy(Hiver.jpg) [function.copy]: failed to open stream: No such file or directory in C:\Program Files\xampp\htdocs\chokri\PHP-SQL\galerie_image_PERSO\index.php on line 60
Code html :
Code php :
Une solution ?
Modifié par darktemplar (18 Mar 2010 - 16:20)
Je n'arrive pas à charger un fichier avec la fonction Copy. Apparement le problème vient du chemin mais j'ai un peu tout essayer et ça me fait toujours cette erreur :
Warning: copy(Hiver.jpg) [function.copy]: failed to open stream: No such file or directory in C:\Program Files\xampp\htdocs\chokri\PHP-SQL\galerie_image_PERSO\index.php on line 60
Code html :
<p>
<form enctype="multipart/form-data" method="post" action="index.php">
<input type="file" name="mon_image"/>
<input type = "submit" name="envoyer" value = "Uploader"/>
</form>
</p>
Code php :
if (isset($_POST['envoyer'])) {
$file_up = $_FILES['mon_image']['name'];
if (!empty($file_up)) {
echo "bon!";
copy($file_up, '../fichiers/'.$file_up); // LIGNE 60
}
else {
echo "erreur !";
}
}
Une solution ?
Modifié par darktemplar (18 Mar 2010 - 16:20)