-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload.php
More file actions
31 lines (24 loc) · 785 Bytes
/
load.php
File metadata and controls
31 lines (24 loc) · 785 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
<?php
if (isset($_FILES["file"])) {
// settings
$path = "/tmp/";
$prefix = "webform";
$tempfile = $path.$prefix.".pdf";
$decimals = 3;
// delete temp documents
unlink($tempfile);
for ($i=0; $i<20; $i++)
{
unlink($path.$prefix."-".str_pad($i,$decimals,"0",STR_PAD_LEFT).".jpg");
}
// make a copy, not to loose it after session
copy($_FILES["file"]["tmp_name"], $tempfile);
// create JPEGs
exec("convert -density 120 \"".$tempfile."\" ".$path.$prefix."-%0".$decimals."d.jpg");
$count = sizeof(glob($path.$prefix."-*.jpg"));
header("Location: ./edit.php?prefix=".$prefix."&start=0&count=".$count."&decimals=".$decimals);
} else {
// No file? Back to upload page.
header('Location: ./index.html');
}
?>