forked from mihai-vlc/upload-class
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.php
41 lines (27 loc) · 780 Bytes
/
test.php
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
<style>
body {
background-color: #333;
color: #fff;
}
</style>
<?php
include 'upload.class.php';
$upload = new Upload;
$upload->upload(); // this will do all the work
$upload->upload('img', array('isImage' => 1)); // this will do all the work
if($upload->errors) {
foreach ($upload->errors as $error) {
echo "Error: ".$error[0]." - ".$error[1]. "<br/>";
}
}
if($upload->success) {
foreach ($upload->success as $success) {
echo "Success: ".$success[0]." - ".$success[1]. "<br/>";
}
}
echo "Upload one file: ";
echo $upload->generateInput(1, "file", 1);
echo "Upload multiple files: ";
echo $upload->generateInput(3, "file", 1, '?', array('class' => 'btn'), array('class' => 'frm'));
echo "Upload image file: ";
echo $upload->generateInput(1, "img", 1);