mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2025-12-11 17:30:37 +01:00
webapp: Doublecheck upload files bounds
This commit is contained in:
@@ -263,7 +263,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
onUploadFileChange() {
|
onUploadFileChange() {
|
||||||
const target = this.$refs.file as HTMLInputElement;
|
const target = this.$refs.file as HTMLInputElement;
|
||||||
if (target.files !== null) {
|
if (target.files !== null && target.files[0]) {
|
||||||
this.file = target.files[0];
|
this.file = target.files[0];
|
||||||
}
|
}
|
||||||
if (!this.file) return;
|
if (!this.file) return;
|
||||||
@@ -302,7 +302,7 @@ export default defineComponent({
|
|||||||
this.uploading = true;
|
this.uploading = true;
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
const target = this.$refs.file as HTMLInputElement; // event.target as HTMLInputElement;
|
const target = this.$refs.file as HTMLInputElement; // event.target as HTMLInputElement;
|
||||||
if (target.files !== null && target.files?.length > 0) {
|
if (target.files !== null && target.files[0]) {
|
||||||
this.file = target.files[0];
|
this.file = target.files[0];
|
||||||
} else {
|
} else {
|
||||||
this.UploadError = this.$t('fileadmin.NoFileSelected');
|
this.UploadError = this.$t('fileadmin.NoFileSelected');
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ export default defineComponent({
|
|||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
if (event !== null) {
|
if (event !== null) {
|
||||||
const target = event.target as HTMLInputElement;
|
const target = event.target as HTMLInputElement;
|
||||||
if (target.files !== null) {
|
if (target.files !== null && target.files[0]) {
|
||||||
this.file = target.files[0];
|
this.file = target.files[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user