Add media type sniffing by extension
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { Attachment, Piece } from "backend/database";
|
||||
import { AttachmentId, PieceId } from "common";
|
||||
import { ACCEPTED_EXTENSIONS } from "common/MediaType";
|
||||
import { ELYSIA_FORM_DATA } from "elysia";
|
||||
import { FormEventHandler, useId, useReducer, useRef, useState } from "react";
|
||||
import { Link, useParams } from "react-router-dom";
|
||||
@@ -254,6 +255,7 @@ function AttachmentForm(props: AttachmentForm.Props) {
|
||||
const file = e.target.files?.item(0) ?? null;
|
||||
reduce(FileReducer.setFile(file));
|
||||
}}
|
||||
accept={ACCEPTED_EXTENSIONS}
|
||||
/>
|
||||
<Button type="submit">
|
||||
Dodaj
|
||||
|
||||
Reference in New Issue
Block a user