How to prevent downloading executable files via input file?

  • 0
    The input file has an accept attribute to which we can add file extensions that can be uploaded.
    And how can you specify file extensions that are not allowed? I need the user to be able to download absolutely any file, except for executables.
    JavaScript Noah Leach, Sep 13, 2020

  • 2 Answers
  • 0
    Implement JavaScript Validation

  • 0
    Checking can be done by redoing file uploads with ajax and sorting out what was in the input.

    But you can do this at the front only to warn the user "hey, dude, you attached some garbage here." Such checks do not provide real protection if this form is attacked - not only without a bypass, but generally without a browser in which it could work.
    Lillian Pratt

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!