diff --git a/src/views/feature/Feature_detail.vue b/src/views/feature/Feature_detail.vue index 2f1ae36aa82ee3f13e455cbf288194aa12629e56..838cfcdfcc98032c2df4b045b57318daaf905a78 100644 --- a/src/views/feature/Feature_detail.vue +++ b/src/views/feature/Feature_detail.vue @@ -458,10 +458,10 @@ export default { //console.log("POST comment", data); }, getAttachmentFileData(evt) { - const input = evt.target.value; - const period = input.lastIndexOf("."); - const fileName = input.substring(0, period); - const fileExtension = input.substring(period + 1); + const files = evt.target.files || evt.dataTransfer.files; + const period = files[0].name.lastIndexOf("."); + const fileName = files[0].name.substring(0, period) + const fileExtension = files[0].name.substring(period + 1); const shortName = fileName.slice(0, 10) + "[...]." + fileExtension; this.comment_form.attachment_file.value = shortName; this.comment_form.title.value = shortName;