1
|
<!DOCTYPE html>
|
2
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
|
3
|
<head>
|
4
|
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
|
5
|
<title>Transfert de panoramique</title>
|
6
|
</head>
|
7
|
<body>
|
8
|
<?php
|
9
|
|
10
|
$dest_dir ='upload';
|
11
|
|
12
|
if (! is_dir($dest_dir)) {
|
13
|
if (! mkdir($dest_dir)) {
|
14
|
$message = 'Dossier "'.$dest_dir.'" non inscriptible ou inexistant.';
|
15
|
}
|
16
|
}
|
17
|
|
18
|
if(!empty($_POST) && !empty($_FILES)) {
|
19
|
foreach (array_keys($_FILES['files']['name']) as $i) {
|
20
|
if(!empty($_FILES['files']['name'][$i])) {
|
21
|
if(isset($_FILES['files']['error'][$i]) && UPLOAD_ERR_OK === $_FILES['files']['error'][$i]) {
|
22
|
move_uploaded_file($_FILES['files']['tmp_name'][$i],$dest_dir.'/'.basename($_FILES['files']['name'][$i]));
|
23
|
printf("<h2>transfert de %s réalisé</h2>\n", $_FILES['files']['name'][$i]);
|
24
|
} else {
|
25
|
$message = 'Une erreur interne a empêché l\'upload de l\'image : '. $_FILES['files']['error'][$i];
|
26
|
}
|
27
|
} else {
|
28
|
$message = 'Veuillez passer par le formulaire svp !';
|
29
|
}
|
30
|
}
|
31
|
if (isset($message)) {
|
32
|
echo "<h2>$message</h2>\n";
|
33
|
}
|
34
|
}
|
35
|
?>
|
36
|
<p>Pour acceder à la liste des images transférées afin de convertir en panorama <a href="creerPano.php">cliquer ici</a></p>
|
37
|
</body>
|
38
|
</html>
|