<label for="user-file" style="display: block;">파일 선택:</label>
<input type="file" id="user-file" style="margin-top: 1em;">
브라우저에서 실제 표시된 모습
<input type="file" multiple>
브라우저에서 실제 표시된 모습
<input type="file" accept="image/*">

<!-- 여러 개의 값 지정 -->
<input type="file" accept="image/*, audio/*">
<input type="file" accept=".jpg">

<!-- 여러 개의 값 지정 -->
<input type="file" accept=".jpg, .pdf">
<input type="file" accept="image/*,.pdf">
<label for="user-file">파일 선택:</label>
<input type="file" id="user-file" disabled>
실제 적용된 모습 파일을 선택하려고 해도 아무런 작동을 하지 않습니다.
<form>
    <p>
       <label for="user-file">파일 선택(*필수):</label>
        <input type="file" id="user-file" required> <!-- 필수 입력 필드로 지정 -->     
    </p>
    <p>
        <button type="submit">제출</button>
    </p>
</form>
브라우저에서 실제 표시된 모습 아무 파일도 선택하지 않고 '제출'버튼을 클릭해보세요!
브라우저가 필수 입력에 대한 오류 메시지를 표시하는 것을 확인할 수 있습니다.
<form action="submit_url" method="post" enctype="multipart/form-data">
    <label for="user-file">파일 업로드</label>
    <input type="file" id="user-file" name="user-file">
    <button type="submit">제출하기</button>
</form>