Skip to content

MIME Type Validation Not Reliable with Renamed File Extensions #1282

@JoyDJ

Description

@JoyDJ

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions