OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

This topic contains 3 replies, has 2 voices, and was last updated by  Mike Kudelya 7 years, 5 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #34284

    manuel.distefano
    Participant

    Hello folks,

    i have a problem. I have a custom entity with a manyToOne to “Oro\Bundle\AttachmentBundle\Entity\File”, and Organization / Owner configured to the entity.

    I have the entity form with FileType. Now, if i try to upload an image all is ok, but if i try to upload a pdf i get “The mime type of the file is invalid (“application/pdf”). Allowed mime types are “image/gif”, “image/jpeg”, “image/png””, caused by vendor/oro/platform/src/Oro/Bundle/AttachmentBundle/Validator/ConfigFileValidator.php

    because it’s not === “file”. How can i configure it? There is a reference where i can check entity configuration?

    Tnx

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #34285

    Mike Kudelya
    Participant

    Hi

    Here is example how you can configure attachment:

    Create migration

    Add form field

    Here is list of available mime types. Allow or disable you can in System -> Configuration -> Upload Settings.

    #34286

    manuel.distefano
    Participant

    Hi Mike,

    There is any way to configure this via @ConfigField annotation?Or any other annotation.

    Tnx

    #34287

    Mike Kudelya
    Participant

    Hi

    As i know it is possible only with migration.

Viewing 3 replies - 1 through 3 (of 3 total)

The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.

Back to top