增加php上传脚本
This commit is contained in:
parent
e018ad18f8
commit
4518cef23d
|
@ -185,9 +185,9 @@
|
||||||
req1.image_path = message['image_path'];
|
req1.image_path = message['image_path'];
|
||||||
socket.send(JSON.stringify(req1));
|
socket.send(JSON.stringify(req1));
|
||||||
|
|
||||||
var req2 = {'func':'upload_local_file', 'iden':'111', 'file_path':'', 'upload_mode':'http', 'http_host':'192.168.100.148', 'http_port':8001};
|
//var req2 = {'func':'upload_local_file', 'iden':'111', 'file_path':'', 'upload_mode':'http', 'http_host':'192.168.100.70', 'http_port':8001, 'http_path':'/upload.php'};
|
||||||
req2.file_path = message['image_path'];
|
//req2.file_path = message['image_path'];
|
||||||
socket.send(JSON.stringify(req2));
|
//socket.send(JSON.stringify(req2));
|
||||||
|
|
||||||
var req3 = {'func':'delete_local_file', 'file_path':''};
|
var req3 = {'func':'delete_local_file', 'file_path':''};
|
||||||
req3.file_path = message['image_path'];
|
req3.file_path = message['image_path'];
|
||||||
|
@ -393,11 +393,12 @@
|
||||||
{
|
{
|
||||||
socket.send(JSON.stringify({
|
socket.send(JSON.stringify({
|
||||||
'func':'upload_local_file',
|
'func':'upload_local_file',
|
||||||
'file_path':'D:\\1.jpg',
|
'file_path':'D:\\5.jpg',
|
||||||
'remote_file_path':'/savedir/123.jpg',
|
'remote_file_path':'/savedir/123.jpg',
|
||||||
'upload_mode':'http',
|
'upload_mode':'http',
|
||||||
'http_host':'192.168.100.148',
|
'http_host':'192.168.1.70',
|
||||||
'http_port':8001
|
'http_port':8001,
|
||||||
|
'http_path':'/upload.php'
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head lang="en">
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Upload</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form action="upload.php" method="post" enctype="multipart/form-data">
|
||||||
|
<input type="file" name="filename"/>
|
||||||
|
<input type="submit" value="submit"/>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$file=$_FILES['filename'];
|
||||||
|
$fileName=$file['name'];
|
||||||
|
move_uploaded_file($file['tmp_name'],$fileName);
|
||||||
|
|
||||||
|
echo "<img style='width:500px' src='$fileName'>";
|
||||||
|
|
||||||
|
?>
|
Loading…
Reference in New Issue