Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
common
Project
Project
Details
Activity
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
曲欣亮
common
Commits
890af5fa
Commit
890af5fa
authored
Aug 10, 2021
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
5f9e9e36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
HttpsUtil.java
src/main/java/com/egolm/common/HttpsUtil.java
+2
-2
No files found.
src/main/java/com/egolm/common/HttpsUtil.java
View file @
890af5fa
...
...
@@ -301,7 +301,7 @@ public class HttpsUtil {
sb
.
append
(
"--"
);
// 必须多两道线
sb
.
append
(
BOUNDARY
);
sb
.
append
(
"\r\n"
);
sb
.
append
(
"Content-Disposition: form-data;name=\"file\";filename=\""
+
file
.
getName
()
+
"\"\r\n"
);
sb
.
append
(
"Content-Disposition: form-data;name=\"file\";filename=\""
+
file
.
getName
()
+
"\"\r\n"
);
sb
.
append
(
"Content-Type:application/octet-stream\r\n\r\n"
);
byte
[]
head
=
sb
.
toString
().
getBytes
(
"utf-8"
);
...
...
@@ -315,7 +315,7 @@ public class HttpsUtil {
// 把文件已流文件的方式 推入到url中
DataInputStream
in
=
new
DataInputStream
(
new
FileInputStream
(
file
));
int
bytes
=
0
;
byte
[]
bufferOut
=
new
byte
[
1024
];
byte
[]
bufferOut
=
new
byte
[
1024
];
// 1M
while
((
bytes
=
in
.
read
(
bufferOut
))
!=
-
1
)
{
out
.
write
(
bufferOut
,
0
,
bytes
);
}
...
...
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