-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
43 lines (34 loc) · 1.36 KB
/
index.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
42
43
<?php
require_once ('lib/FileUploader.php');
$fu = new FileUploader();
try
{
$fu->setUploadDirectory('upload/');
$fu->setValidMIME(array('application/octet-stream',
'application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip',
'image/jpeg', 'image/pjpeg', 'image/jpeg', 'image/pjpeg'));
$fu->setValidExtensions(array('zip', 'jpg', 'jpeg'));
$fu->setMaxFileSize(500000);
$files = $fu->upload();
/*
foreach ($this->files as $file)
{
//do with file what do you want :)
}
*/
$fu->moveUploadedFiles($files);
}
catch (Exception $e)
{
echo $e->getMessage();
}
?>
<form method="post" action="" enctype="multipart/form-data">
<p>Upload File 1: <input name="upload[]" type="file" class="inputtext" /></p>
<p>Upload File 2: <input name="upload[]" type="file" class="inputtext" /></p>
<p>Upload File 3: <input name="upload[]" type="file" class="inputtext" /></p>
<p>Upload File: <input name="uploadOne" type="file" class="inputtext" /></p>
<p>Upload2 File 1: <input name="upload2[]" type="file" class="inputtext" /></p>
<p>Upload2 File: <input name="uploadOne2" type="file" class="inputtext" /></p>
<input type="submit" name="submit" value="Upload File" />
</form