-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform.php
More file actions
56 lines (49 loc) · 2.07 KB
/
Copy pathform.php
File metadata and controls
56 lines (49 loc) · 2.07 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
require_once "upload.php";
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Upload de fichiers</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
</head>
<body>
<h1 class="page-header text-center">Upload multiple de fichiers</h1>
<div class="container">
<form method="POST" enctype="multipart/form-data" action="upload.php">
Fichier (jpg, png ou gif. Max. 1Mo) : <input id='image' name="image[]" type="file" multiple="multiple"/>
<input type="hidden" name="MAX_FILE_SIZE" value="1000000"> <!-- Taille max 1Mo -->
<input type="submit" value="Submit" name="submit" />
</form>
</div>
<h2>Fichiers téléchargés :</h2>
<div class="container">
<div class="row">
<?php
$uploadDirectory = 'upload/';
$files = scandir($uploadDirectory);
foreach ($files as $file) {
$fileDirectory = $uploadDirectory . $file;
if (($file != '.') && ($file != '..')) {
?>
<div class="col img-thumbnail">
<img src="upload/<?= $file ?>">
<p><?= $file ?></p>
<?php if (file_exists($fileDirectory)) {
?>
<form method="post" action="delete.php">
<button type="submit" class="btn btn-danger" name="submit" id="submit" value="<?= $fileDirectory ?>">Supprimer</button>
</form>
<?php } ?>
</div>
<?php
}
}
?>
</div>
</div>
</body>
</html>