---
title: "Discussion on \"How to Validate File Type Using Magic Bytes and MIME Type in Javascript\" | Hashnode"
description: "Discussion on \"How to Validate File Type Using Magic Bytes and MIME Type in Javascript\". Checking File Types by Reading File Content"
url: "https://hashnode.com/posts/how-to-validate-javascript-file-types-with-magic-bytes-and-mime-type/6678ddfa6874fcd0d44856c4"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Validate File Type Using Magic Bytes and MIME Type in Javascript](https://pye.hashnode.dev/how-to-validate-javascript-file-types-with-magic-bytes-and-mime-type?utm_source=hashnode&utm_medium=feed)

Checking File Types by Reading File Content

Jun 24, 2024 · 5 min read · pye.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#file-upload](https://hashnode.com/tag/file-upload)
-   [#mime-types](https://hashnode.com/tag/mime-types)
-   [#validation](https://hashnode.com/tag/validation)
-   [#files](https://hashnode.com/tag/files)

## Written by

[Pius Iniobong](https://hashnode.com/@pye)

@pye · Lagos, Nigeria

  
[View profile](https://hashnode.com/@pye)

Software Engineer | Designing AI-Assisted Experiences & Platform Foundations

Software Engineer | Designing AI-Assisted Experiences &amp; Platform Foundations

## Responses 1

Markdown supported · ⌘↵ to post

[Otobong Akpanudo](https://hashnode.com/@OttyHaQ)

[Jul 5, 2024](https://hashnode.com/posts/how-to-validate-javascript-file-types-with-magic-bytes-and-mime-type/6678ddfa6874fcd0d44856c4/comment/6687d05eb7a5fcfbb31b4340)

This was quite insightful. You just made my life easier.

[Pius Iniobong](https://hashnode.com/@pye)

[Apr 24, 2025](https://hashnode.com/posts/how-to-validate-javascript-file-types-with-magic-bytes-and-mime-type/6678ddfa6874fcd0d44856c4/comment/6687d05eb7a5fcfbb31b4340#reply-680a03c8ad52a6c503f02a74)

I'm glad you found this article helpful.
