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

MimeType option question #313

Open
JonathanDaflon opened this issue Jun 24, 2021 · 1 comment
Open

MimeType option question #313

JonathanDaflon opened this issue Jun 24, 2021 · 1 comment

Comments

@JonathanDaflon
Copy link

Hi, I'm currently testing an application that can be configured to accept or deny some mimeTypes based on the customer settings. So I'm using this lib to upload files, and it has worked great, but I stumbled on this scenario where I want to set a different mimeType for an extension (example: 'file.pdf' with mimeType 'video/x-ms-wmv') to see if everything works fine.

Current Behavior:
Setting a mimeType option doesn't alter the mimeType of the file (even if cypress says it does).

Sem título

Desired Behavior:
Setting a mimeType option should change the file mimeType.

Question:
Is this behavior intended? The mimeType option just describes the file type or it should change the type?

Steps to reproduce:
obs: I'm using cucumber.
The website visited tests the file to get its mimeType.

Given('test', () => {
    cy.visit('https://www.htmlstrip.com/mime-file-type-checker');
    cy.get('input#file')
    .attachFile({
        filePath: 'your_file.pdf',
        fileName: `some_name.mp4`,
        mimeType: 'video/x-ms-wmv',
        encoding: 'base64'
    })

    cy.get('button')
        .contains('Find File')
        .click()
})
@aldipower
Copy link

I have a simillar problem here, which makes my upload fail.
The "Content-type" in the multipart/form-data for the file is not set and is just "null", not respecting the mimeType setting.

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

2 participants