Skip to content

How to link a document to a .pdf file + filter on extension #99

@nicolas-bastien

Description

@nicolas-bastien

Hi,

I spent time reading the doc and looking at the sandbox and right now I found how to link my document to an image with a 'cmf_media_image' form type but nothing for simple file.

When I try to use a file form type i have this error :
*
The form's view data is expected to be an instance of class Symfony\Component\HttpFoundation\File\File, but is an instance of class PHPCRProxies__CG__\Symfony\Cmf\Bundle\MediaBundle\Doctrine\Phpcr\File. You can avoid this error by setting the "data_class" option to null or by adding a view transformer that transforms an instance of class PHPCRProxies__CG__\Symfony\Cmf\Bundle\MediaBundle\Doctrine\Phpcr\File to an instance of Symfony\Component\HttpFoundation\File\File.
*

I need this to have a downloadable pdf file and a video.

I don't understand why there is no 'cmf_media_file' form type ?

And is there a way to limit to a list of file extension ?

Thanks a lot

Nico

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions