restrict file upload size on site
This commit is contained in:
parent
12f89ade59
commit
a2bea009a2
@ -34,6 +34,36 @@ footer
|
|||||||
color: #03A9F4
|
color: #03A9F4
|
||||||
text-shadow: 2px 2px 1px #0059a0
|
text-shadow: 2px 2px 1px #0059a0
|
||||||
margin-right: 5px
|
margin-right: 5px
|
||||||
|
.socialbtn
|
||||||
|
width: 28px
|
||||||
|
height: 28px
|
||||||
|
display: inline-block
|
||||||
|
line-height: 28px
|
||||||
|
color: #fff
|
||||||
|
font-size: 160%
|
||||||
|
border-radius: 100px
|
||||||
|
padding: 2px
|
||||||
|
margin: 5px
|
||||||
|
&#github
|
||||||
|
background-color: #000
|
||||||
|
&#twitter
|
||||||
|
background-color: #03a9f4
|
||||||
|
&#discord
|
||||||
|
background-color: #2C2F33
|
||||||
|
.discordlogo
|
||||||
|
position: relative
|
||||||
|
top: 3px
|
||||||
|
background: url(/static/image/Discord-Logo-White.svg)
|
||||||
|
width: 22px
|
||||||
|
height: 22px
|
||||||
|
display: inline-block
|
||||||
|
i
|
||||||
|
position: relative
|
||||||
|
right: 1px
|
||||||
|
span.divider
|
||||||
|
color: #ddd
|
||||||
|
margin: 0 5px
|
||||||
|
cursor: default
|
||||||
|
|
||||||
@media all and (max-width: 800px)
|
@media all and (max-width: 800px)
|
||||||
footer
|
footer
|
||||||
|
@ -456,33 +456,6 @@ span.load
|
|||||||
cursor: help
|
cursor: help
|
||||||
font-size: 19px
|
font-size: 19px
|
||||||
|
|
||||||
.socialbtn
|
|
||||||
width: 28px
|
|
||||||
height: 28px
|
|
||||||
display: inline-block
|
|
||||||
line-height: 28px
|
|
||||||
color: #fff
|
|
||||||
font-size: 160%
|
|
||||||
border-radius: 100px
|
|
||||||
padding: 2px
|
|
||||||
margin: 5px
|
|
||||||
&#github
|
|
||||||
background-color: #000
|
|
||||||
&#twitter
|
|
||||||
background-color: #03a9f4
|
|
||||||
&#discord
|
|
||||||
background-color: #2C2F33
|
|
||||||
.discordlogo
|
|
||||||
position: relative
|
|
||||||
top: 3px
|
|
||||||
background: url(/static/image/Discord-Logo-White.svg)
|
|
||||||
width: 22px
|
|
||||||
height: 22px
|
|
||||||
display: inline-block
|
|
||||||
i
|
|
||||||
position: relative
|
|
||||||
right: 1px
|
|
||||||
|
|
||||||
.dialog-drop
|
.dialog-drop
|
||||||
display: block
|
display: block
|
||||||
position: fixed
|
position: fixed
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
.inputting
|
.inputting
|
||||||
h3 Upload new
|
h3 Upload new
|
||||||
.message.error
|
.message.error
|
||||||
|
small Max filesize: 1 MB, only .png and .jpg allowed
|
||||||
|
br
|
||||||
input(type="file", id="fileinput")
|
input(type="file", id="fileinput")
|
||||||
.editor(style="display: none")
|
.editor(style="display: none")
|
||||||
h3 Crop the image
|
h3 Crop the image
|
||||||
@ -125,6 +127,8 @@ script.
|
|||||||
message('This browser doesn\'t seem to support the `files` property of file inputs.')
|
message('This browser doesn\'t seem to support the `files` property of file inputs.')
|
||||||
} else if (!input.files[0]) {
|
} else if (!input.files[0]) {
|
||||||
message('Please select a file.')
|
message('Please select a file.')
|
||||||
|
} else if (input.files[0].size > 1000000) {
|
||||||
|
message('This file is too big. Max: 1 MB')
|
||||||
} else {
|
} else {
|
||||||
file = input.files[0]
|
file = input.files[0]
|
||||||
fr = new FileReader()
|
fr = new FileReader()
|
||||||
|
Reference in New Issue
Block a user