Niraj Choubey
Niraj Choubey

Reputation: 4040

exe file upload prevention

In my project i have created a file upload.Now it is required that any exe file or exe file in a zip folder having .zip as extension, be prevented from being uploaded. Can someoe suggest me a solution?

Upvotes: 0

Views: 1569

Answers (1)

abatishchev
abatishchev

Reputation: 100308

For each of your task, you have to implement separate algorithm for check.

  • Check extension before upload (see possible duplicate question)
  • Check that uploaded zip is really an archive (mime type, libmagic, etc)
  • Check that uploaded archive doesn't contain exe (unzip it, see previous paragraph)

Upvotes: 3

Related Questions