forked from twpayne/igc2kmz.py
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupload.php
More file actions
39 lines (38 loc) · 1.2 KB
/
upload.php
File metadata and controls
39 lines (38 loc) · 1.2 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
<?php
if(isset($_POST['btn-upload']))
{
$pic = rand(1000,100000)."-".$_FILES['pic']['name'];
$pic_loc = $_FILES['pic']['tmp_name'];
$folder="uploaded_files/";
$cmd = "./i2k $folder$pic $pic_loc";
system($cmd,$ret_val);
echo "<meta http-equiv=\"refresh\" content=\"1;URL=index.php\">";
}
if(isset($_POST['btn-url-up']))
{
$url_in = $_POST["pic"];
$cmd = "./url-up $url_in";
system($cmd,$ret_val);
echo "<meta http-equiv=\"refresh\" content=\"1;URL=index.php\">";
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>IGC to KMZ converter</title>
</head>
<body>
<h4 style="padding-left:10px">Upload IGC tracklog</h4>
<form action="" method="post" enctype="multipart/form-data">
<div style="padding-left:20px">
<input type="file" name="pic" accept=".igc"/>
<button type="submit" name="btn-upload">upload</button>
</div>
<!--h4 style="padding-left:10px">Or</h4>
<div style="padding-left:20px">
<input type="text" onfocus="this.value=''" value="Paste igc URL here" name="pic"/>
<button type="submit" name="btn-url-up">upload from URL</button-->
</div>
</form>
</body>