recuperer variable d'un $_FILES
Salut,
J'ai un soucis pour récuperer la valeur d'un $_FILES dans une variable de session voici mon code
Code:
1 2 3 4 5 6 7 8 9 10
| <form action="server/script.php" method="post" enctype="multipart/form-data" id="form-demo">
<table width="400" border="0">
<tr>
<td class="bas">Envoyer un fichier :
<input type="file" name="Filedata" /></td>
</tr>
<tr>
<td><input type="submit" name="button" id="button" value="Envoyer"></td>
</tr>
</table> |
et voici la page script.php
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| move_uploaded_file($_FILES['Filedata']['tmp_name'], '../uploads/' . $_FILES['Filedata']['name']);
$return['src'] = '/uploads/' . $_FILES['fichier']['name'];
if ($error) {
$return = array(
'status' => '0',
'error' => $error
);
} else {
$return = array(
'status' => '1',
'name' => $_FILES['Filedata']['name']
);
$return2 = array(
$_FILES['Filedata']['name']
); |
puis ensuite je recupere le nom dans une variable de session mais la variable apres un echo est vide
Code:
1 2 3 4
| session_start();
$_SESSION['Filedata'] = $_FILES['Filedata']['name'];
$Filedata = $_SESSION['Filedata'];
} |
si je fais un echo de $Filedata je n'ai rien
J'utilise un systeme d'upload nommé fancyupload qui fonctionne pas trop mal mise a part ce petit soucis.
Merci de votre aide.