-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetfile.php
More file actions
52 lines (38 loc) · 1.18 KB
/
getfile.php
File metadata and controls
52 lines (38 loc) · 1.18 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
<html>
<head>
<title>Process Uploaded File</title>
</head>
<body>
<?php
error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
ini_set('error_log', 'errors.log');
ini_set('log_errors', 'On');
echo "file is " . $_FILES['uploadFile'] ['tmp_name'] . "<br><br>";
$target_file = $_FILES['uploadFile'] ['tmp_name'];
define ('BASE_PATH', dirname(__FILE__));
define ('PHP_POWERPOINT', BASE_PATH . '/lib/');
/*
function __autoload($class) {
// convert namespace to full file path
$class = str_replace('\\', '/', $class) . '.php';
require_once($class);
}
*/
// use phpoffice\powerpoint\PowerPoint;
echo "BASE_PATH : " . BASE_PATH . '<br>';
echo "PHP_POWERPOINT: " . PHP_POWERPOINT . '<br><br>';
echo "including powerpoint lib<br>";
include PHP_POWERPOINT . 'PowerPoint.php';
echo "loading powerpoint<br>";
$powerpoint = new Powerpoint($target_file);
echo "building powerpoint<br>";
$powerpoint->buildAll();
echo "Number of slides: " . $powerpoint->getNumberOfSlides() . "<br>";
echo "The first slide is: " . $powerpoint->getSlide(0)->filename . "<br>";
echo $powerpoint->getHTML("page", "[", "]");
unlink($_FILES['uploadFile'] ['tmp_name']);
echo "<br>file removed<br>";
?>
</body>
</html>