Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Chiefs
ChiefSend2
Commits
fd5b06da
Commit
fd5b06da
authored
Mar 27, 2021
by
Lukas Böhm
Browse files
Update Upload.html
parent
4f66669f
Changes
1
Hide whitespace changes
Inline
Side-by-side
web-flask/templates/Upload.html
View file @
fd5b06da
...
...
@@ -61,7 +61,7 @@
$
(
"
.custom-file-input
"
).
on
(
"
change
"
,
function
()
{
let
fns
=
$
(
this
)[
0
].
files
;
let
label
=
""
;
for
(
var
i
=
0
;
i
<
fns
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
fns
.
length
;
i
++
)
{
label
=
label
.
concat
(
fns
[
i
].
name
);
if
(
i
<
fns
.
length
-
1
)
label
=
label
.
concat
(
"
,
"
);
}
...
...
@@ -69,7 +69,7 @@
});
</script>
<script>
let
share
=
{}
let
share
=
{}
;
function
openShare
()
{
$
.
ajax
({
...
...
@@ -83,11 +83,19 @@
}).
done
((
response
)
=>
{
share
=
response
;
disableAll
();
uploadFile
();
uploadFile
s
();
});
}
function
uploadFile
()
{
function
uploadFiles
()
{
for
(
file
in
$
(
"
.custom-file-input
"
)[
0
].
files
)
{
var
formData
=
new
FormData
();
var
request
=
new
XMLHttpRequest
();
formData
.
set
(
'
files
'
,
file
);
request
.
open
(
"
POST
"
,
`http://localhost:6969/share/
${
share
.
id
}
/attachments`
);
request
.
send
(
formData
);
}
closeShare
();
}
...
...
@@ -100,8 +108,9 @@
"
Content-Type
"
:
"
application/json
"
},
"
data
"
:
JSON
.
stringify
({}),
}).
done
(()
=>
{
window
.
location
.
href
=
"
/d/
"
+
share
.
id
}).
done
((
response
)
=>
{
console
.
log
(
response
);
{
#
window
.
location
.
href
=
"
/d/
"
+
share
.
id
;
#
}
});
}
</script>
...
...
Write
Preview
Supports
Markdown
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