Skip to content

Commit 0313c00

Browse files
author
lobtao
committed
add Feture
增加input type=file获取本地路径
1 parent b09d551 commit 0313c00

30 files changed

+463
-23
lines changed

Win32/debug/app/Application/Home/Controller/IndexController.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,8 @@ function msg2() {
7474
function iframe() {
7575
$this->show();
7676
}
77+
78+
function input(){
79+
$this->show();
80+
}
7781
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: lobtao
5+
* Date: 2018/9/3
6+
* Time: 10:38
7+
*/
8+
9+
namespace Home\Controller;
10+
11+
use app\service\Curl;
12+
use app\service\TestService;
13+
use Think\Controller;
14+
15+
class WsController extends Controller{
16+
public function index(){
17+
//echo 'hello websocket,远思软件欢迎您!'.I('data');
18+
//echo '收到消息:'.I('data');
19+
print_r($_SERVER);
20+
// echo file_get_contents("php://input");
21+
}
22+
}

Win32/debug/app/Application/Home/View/index/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@
8181
<button onclick="sendMsg3()">发送消息3</button>
8282

8383
<div id="dRet"></div>
84+
85+
86+
<hr>
87+
<a href="<?php echo U('index/input');?>" target="_blank">表单测试</a>
8488
</div>
8589

8690
<div id="timer">
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!DOCTYPE html>
2+
<html lang="zh-cn">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>input测试</title>
6+
7+
</head>
8+
<body>
9+
10+
<div>
11+
<form method="get" id="fform" enctype="multipart/form-data">
12+
<p><input id="ffile" type="file" name="ffile" multiple /></p>
13+
<input type="submit" value="Submit" />
14+
</form>
15+
<button id="btTest">提交</button>
16+
</div>
17+
18+
<div id="timer">
19+
20+
</div>
21+
22+
23+
<script src="Public/static/jquery-1.12.4.min.js"></script>
24+
<script>
25+
var FFileName = '';
26+
window.onFile = function (fileName) {
27+
FFileName = fileName;
28+
console.log(fileName);
29+
}
30+
31+
$(function () {
32+
$('#ffile').change(function (ret) {
33+
alert(FFileName);
34+
})
35+
})
36+
</script>
37+
</body>
38+
</html>

Win32/debug/app/index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
<?php
23
// +----------------------------------------------------------------------
34
// | ThinkPHP [ WE CAN DO IT JUST THINK ]

Win32/debug/browse.exe

1.5 KB
Binary file not shown.

Win32/debug/config.json

138 Bytes
Binary file not shown.

Win32/debug/niu_new.exe

30 KB
Binary file not shown.

Win32/debug/server_php.dll

0 Bytes
Binary file not shown.

Win32/debug/server_ws.dll

1.1 MB
Binary file not shown.

0 commit comments

Comments
 (0)