symfony2admingenerator / AvocodeFormExtensionsBundle

(old-legacy) Symfony2 form extensions for Admingenerator project (also working standalone!)
Other
48 stars 31 forks source link

filter by extension #149

Closed nicoip closed 10 years ago

nicoip commented 10 years ago

Hello,

how can one filter by extension in the window of the upload (eg jpg, png, gif) ?

us

thank you

ioleo commented 10 years ago

@nicoip This can be achieved by adding

files:
    formType: afe_collection_upload
# or s2a_collection_upload if you use the new-unstable repository
    addFormOptions:
        attr:
            accept: "text/plain"  # or any other mimetype

See this SO anwser

This is not afe_collection_upload feature though. It will only make the form render with HTML accept attribute

<input type="file" accept="text/plain">

nicoip commented 10 years ago

Thank you very much, It works :)

But can not we hide "All files (. )"?

us

ioleo commented 10 years ago

@nicoip I don't know. I've never had the need to use it. Just google or try StackOverflow.