Upload de file ???

Fermé
scout-boy Messages postés 98 Date d'inscription mercredi 29 septembre 2010 Statut Membre Dernière intervention 21 mai 2014 - 15 mars 2011 à 14:16
Zep3k!GnO Messages postés 2025 Date d'inscription jeudi 22 septembre 2005 Statut Membre Dernière intervention 18 novembre 2015 - 15 mars 2011 à 17:39
Bonjour,

je travaille avec le PHP et je veux faire une importation d'une file a partir de mon ordinateur , j'ai fais une essai mais j'arrive a importer une seule composant de dossier et non pas a toute le dossier : voila par la suite mon script d'essai ;et j'espère que vous pouvez m'aider

<form enctype="multipart/form-data" action="az3.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
<input name="uploadedfile" type="file" />
<input name="up" type="submit" value="Upload File" />
</form>

<?php
if (isset($_POST['up'])){
$target_path = "C:/wamp/www/administrateur-site/images/1234/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}}
?>

merci D'avance mes amis ^_^
A voir également:

1 réponse

Zep3k!GnO Messages postés 2025 Date d'inscription jeudi 22 septembre 2005 Statut Membre Dernière intervention 18 novembre 2015 200
15 mars 2011 à 17:39
$target_path = "C:/wamp/www/administrateur-site/images/1234/"; 

Un chemin windows s'écrit avec des anti-slash et non des slash comme sous unix.
Attention, l'anti-slash étant considéré comme un caractère d'échappement, sous WAMP :
$target_path = "C:\\wamp\\www\\administrateur-site\\images\\1234\\"; 
0