Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIME Type Validation Not Reliable with Renamed File Extensions #1282

Open
JoyDJ opened this issue Oct 15, 2024 · 0 comments
Open

MIME Type Validation Not Reliable with Renamed File Extensions #1282

JoyDJ opened this issue Oct 15, 2024 · 0 comments

Comments

@JoyDJ
Copy link

JoyDJ commented Oct 15, 2024

I encountered an issue with the ng2-file-upload library where MIME type validation is not functioning as expected. Specifically, I was able to upload a .wav file after renaming it to .pdf, which should not be allowed.

Actual Behavior:
When I renamed a .wav file to .pdf and uploaded it, the system accepted the file, and the MIME type detected was application/pdf, which is incorrect.

const uploader = new FileUploader({
url: 'api/endpoint',
allowedFileType: ['pdf'],
allowedMimeType: [ 'application/pdf',],
});

Steps to Reproduce:

  • Rename the file from audio.wav to audio.pdf.
  • Use the ng2-file-upload library to upload the renamed file.
  • Observe that the upload succeeds and the file is accepted as application/pdf.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant