My favorites | Sign in
Project Logo
                
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php

/*
* Copyright 2008 Jeffrey Palm
*/


include '../config.php';
include '../../common.php';
include '../../class.CronJob.php';
include 'fileupload/fileupload.class.php';

$upload = new fileupload();
$upload->set_max_filesize(5 * 1000000);
$upload->set_overwrite_mode(2);
$dir = 'uploads/';
$filename = $upload->upload("file", $dir);
$description = $_REQUEST['description'];
$location = $_REQUEST['location'];
$lat = $_REQUEST['lat'];
$lng = $_REQUEST['lng'];
if ($filename) {
$file = $dir.$filename;
$sec = datetime();
$c = new CronJob();
$c->processImageFile($file,$sec,$description,$location,$lat,$lng);

$resolved = true;
}

if ($resolved) {

$code = 'ok';
echo '<?xml version="1.0" encoding="utf-8" ?>';
echo '<rsp stat="' . $code . '">';

echo '<description>' . $description . '</description>';
echo '<location>' . $location . '</location>';
echo '<file>' . $newFile . '</file>';

echo '</rsp>';

} else {


?>

<html>
<body>

<form action="<?php echo $_SERVER['PHP_SELF'];?>" enctype="multipart/form-data" method="post">
<p>
<table border=0 cellpadding= cellspacing=0>
<tr><td>File: </td><td><input name="file" id="file" type="file"></td><tr>
<tr><td>Description: </td><td><input type="text" size="50" name="description"></td></tr>
<tr><td>Location: </td><td><input type="text" size="50" name="location"></td></tr>
<tr><td>Latitude: </td><td><input type="text" size="50" name="lat"></td></tr>
<tr><td>Longitude: </td><td><input type="text" size="50" name="lng"></td></tr>
<tr><td><input class=tbox type=submit value="Upload file"></td></tr>
</table>
<?php
if ($error) {
echo '<p style="color:red">';
echo $error;
echo '</p>';
} else if ($resolved) {
echo '<p style="color:green">';
echo $file . ' uploaded';
echo '</p>';
}
?>
</p>
</form>

</body>
</html>

<?php
}

?>

Show details Hide details

Change log

r39 by jeffpalm on Dec 29, 2008   Diff
added desktop version
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 1997 bytes, 82 lines
Hosted by Google Code