bonjour,

en fait je rame un peu.

je dois uploader un fichier a partir d'un site puis le stocker dans un autre fichier.

voici mon script:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
if (isset($_POST['upload']) && $_POST['upload'] == 'Upload') 
{
  if ($_FILES["file"]["error"] > 0)
    {
    echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
    }
  else
    {
    echo "Upload: " . $_FILES["file"]["name"] . "<br />";
    echo "Type: " . $_FILES["file"]["type"] . "<br />";
    echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
    echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
 
    if (file_exists("upload/" . $_FILES["file"]["name"]))
      {
      echo $_FILES["file"]["name"] . " already exists. ";
      }
    else
      {
      move_uploaded_file($_FILES["file"]["tmp_name"],
      "Fichier/" . $_FILES["file"]["name"]);
      echo "Stored in: " . "Fichier/" . $_FILES["file"]["name"];
      }
    }
 
}
et le formulaire html
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<form action="index.php" method="post" enctype="multipart/form-data">
          <table>
 
		     <tr>
			    <td>
                 Nom du fichier:
				</td>
				<td>
				 <input type="file" name="fichier"  />
				</td>
		     </tr>
			 <td>
			 </td>
			 <td  align="right">
                <input type="submit" name="upload" value="Upload" />
             </td>
		   </table> 
			 </form>
quelqu'un pourrait il m'aider