Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AssignmentSystem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Müntz
AssignmentSystem
Commits
2a19fa50
Commit
2a19fa50
authored
2 months ago
by
Richard Taesler
Browse files
Options
Downloads
Patches
Plain Diff
Assignment upload file extension fix realy
parent
c69a01f5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/AssignmentTutor.html
+5
-5
5 additions, 5 deletions
source/AssignmentTutor.html
source/Course.html
+5
-5
5 additions, 5 deletions
source/Course.html
with
10 additions
and
10 deletions
source/AssignmentTutor.html
+
5
−
5
View file @
2a19fa50
...
@@ -206,10 +206,6 @@
...
@@ -206,10 +206,6 @@
fileInput
.
addEventListener
(
"
change
"
,
(
event
)
=>
{
fileInput
.
addEventListener
(
"
change
"
,
(
event
)
=>
{
const
files
=
event
.
target
.
files
;
// Ausgewählte Dateien
const
files
=
event
.
target
.
files
;
// Ausgewählte Dateien
if
(
files
.
length
>
0
)
{
if
(
files
.
length
>
0
)
{
alert
(
`Du hast folgende Datei ausgewählt:
${
files
[
0
].
name
}
`
,
);
// Überprüfung im JavaScript (optional)
// Überprüfung im JavaScript (optional)
const
allowedExtensions
=
[
const
allowedExtensions
=
[
"
jpg
"
,
"
jpg
"
,
...
@@ -218,7 +214,7 @@
...
@@ -218,7 +214,7 @@
"
zip
"
,
"
zip
"
,
"
txt
"
,
"
txt
"
,
];
];
const
fileExtension
=
selectedFile
.
name
const
fileExtension
=
files
[
0
]
.
name
.
split
(
"
.
"
)
.
split
(
"
.
"
)
.
pop
()
.
pop
()
.
toLowerCase
();
.
toLowerCase
();
...
@@ -227,6 +223,10 @@
...
@@ -227,6 +223,10 @@
"
Ungültige Datei! Bitte wähle eine Datei mit der Endung .jpg, .jpeg oder .png.
"
,
"
Ungültige Datei! Bitte wähle eine Datei mit der Endung .jpg, .jpeg oder .png.
"
,
);
);
fileInput
.
value
=
""
;
// Zurücksetzen
fileInput
.
value
=
""
;
// Zurücksetzen
}
else
{
alert
(
`Du hast folgende Datei ausgewählt:
${
files
[
0
].
name
}
`
,
);
}
}
}
}
});
});
...
...
This diff is collapsed.
Click to expand it.
source/Course.html
+
5
−
5
View file @
2a19fa50
...
@@ -197,10 +197,6 @@
...
@@ -197,10 +197,6 @@
fileInput
.
addEventListener
(
"
change
"
,
(
event
)
=>
{
fileInput
.
addEventListener
(
"
change
"
,
(
event
)
=>
{
const
files
=
event
.
target
.
files
;
// Ausgewählte Dateien
const
files
=
event
.
target
.
files
;
// Ausgewählte Dateien
if
(
files
.
length
>
0
)
{
if
(
files
.
length
>
0
)
{
alert
(
`Du hast folgende Datei ausgewählt:
${
files
[
0
].
name
}
`
,
);
// Überprüfung im JavaScript (optional)
// Überprüfung im JavaScript (optional)
const
allowedExtensions
=
[
const
allowedExtensions
=
[
"
jpg
"
,
"
jpg
"
,
...
@@ -209,7 +205,7 @@
...
@@ -209,7 +205,7 @@
"
zip
"
,
"
zip
"
,
"
txt
"
,
"
txt
"
,
];
];
const
fileExtension
=
selectedFile
.
name
const
fileExtension
=
files
[
0
]
.
name
.
split
(
"
.
"
)
.
split
(
"
.
"
)
.
pop
()
.
pop
()
.
toLowerCase
();
.
toLowerCase
();
...
@@ -218,6 +214,10 @@
...
@@ -218,6 +214,10 @@
"
Ungültige Datei! Bitte wähle eine Datei mit der Endung .jpg, .jpeg oder .png.
"
,
"
Ungültige Datei! Bitte wähle eine Datei mit der Endung .jpg, .jpeg oder .png.
"
,
);
);
fileInput
.
value
=
""
;
// Zurücksetzen
fileInput
.
value
=
""
;
// Zurücksetzen
}
else
{
alert
(
`Du hast folgende Datei ausgewählt:
${
files
[
0
].
name
}
`
,
);
}
}
}
}
});
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment