-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathexample.php
More file actions
35 lines (29 loc) · 913 Bytes
/
Copy pathexample.php
File metadata and controls
35 lines (29 loc) · 913 Bytes
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
<?php
require_once "PiramideUploader.php";
if(isset($_FILES["image"])){
$piramideUploader = new PiramideUploader();
$upload = $piramideUploader->upload("my-upload-name", "image", "uploads", array("image/jpeg","image/png","image/gif"));
}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Example Piramide Uploader</title>
</head>
<body>
<h2>Simple Piramide Uploader Form</h2>
<?php
if(isset($upload) && $upload["uploaded"]){
echo "<p>Upload file data in php array:</p>";
var_dump($piramideUploader->getInfoFile());
}elseif(isset($upload) && $upload["uploaded"] == false){
echo "<p>The file could not be uploaded</p>";
echo "<p>Error: ".$upload["error"]."</p>";
}
?>
<form action="" enctype="multipart/form-data" method="POST">
<input type="file" name="image" id="image"/>
<input type="submit" name="submit" value="Upload" />
</form>
</body>
</html>