-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
executable file
·66 lines (43 loc) · 991 Bytes
/
test.php
File metadata and controls
executable file
·66 lines (43 loc) · 991 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
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
<pre>
<?php
// respond to AJAX calls
include("/share1/proj/eem/templates/functions.php");
$copy = copyUploadedFile("http://www.hgc.jp/~tremmel/test.tab", 'expression_remote.tab');
if ($copy) {
echo "ok";
} else {
"error";
}
function copyUploadedFile($inputFileName, $fileName) {
global $id;
$id = "xfVC6";
$dir = DATAPATH . "$id/";
echo $dir;
// Create folder, if it does not exist
if (!file_exists($dir))
@mkdir($dir);
$outputPath = $dir . $fileName;
/*
if ($_POST[$selector]=="local") {
if (move_uploaded_file($inputFileName['tmp_name'], $outputPath)) {
return true;
}
}
if ($_POST[$selector]=="remote") {
// open & save
$data = file_get_contents($inputFileName);
file_put_contents($outputPath, $data);
return true;
}
*/
// copy? permissions... open & save
// open & save
if ($data = file_get_contents($inputFileName)) {
if (file_put_contents($outputPath, $data)) {
return true;
}
}
return false;
}
?>
</pre>