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

Save Failed: The MIME type "application/pdf" is not accepted #2943

Closed
ricardo118 opened this issue Jun 20, 2020 · 7 comments
Closed

Save Failed: The MIME type "application/pdf" is not accepted #2943

ricardo118 opened this issue Jun 20, 2020 · 7 comments
Assignees

Comments

@ricardo118
Copy link
Contributor

Saving pdf to the pages flex media does not work

Preview

@rhukster
Copy link
Member

I think a bigger issue that has been raised is that media uploads are not uploaded instantly. Only on save. This is not the same as existing pages behavior.

@ricardo118
Copy link
Contributor Author

@rhukster yeah i was investigating this and its because current flex pages upload is using the task from the "type: file", which has

    /** @var array */
    private $_upload_defaults = [
        'self'              => true,        // Whether path is in the media collection path itself.
        'avoid_overwriting' => false,       // Do not override existing files (adds datetime postfix if conflict).
        'random_name'       => false,       // True if name needs to be randomized.
        'accept'            => ['image/*'], // Accepted mime types or file extensions.
        'limit'             => 10,          // Maximum number of files.
        'filesize'          => null,        // Maximum filesize in MB.
        'destination'       => null         // Destination path, if empty, exception is thrown.
    ];

where as admin uses 2 seperate tasks for "type:pagemedia" and "type: file". Type file checks for the "accept:" in settings and defaults to images only, where are type: pagemedia doesnt look for file MIME types at all, taskAddmedia

@ricardo118
Copy link
Contributor Author

also regarding the upload instantly, it does upload instant, but only to the "tmp" folder only later does it get transfered over. I guess this was done to allow media uploading prior to first page save?

Maybe can be expanded to save to tmp if page doesnt exist yet (no first save) and if it does, automatically move it

@hotdoy
Copy link

hotdoy commented Jun 27, 2020

Does the same with everything that is not an image.

@rhukster
Copy link
Member

This is fixed already in 1.7 branch.

@mahagr
Copy link
Member

mahagr commented Jul 9, 2020

There was a case I missed. Should be fixed now.

@hotdoy
Copy link

hotdoy commented Jul 14, 2020

Looking good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants