eZ Community » Forums » Developer » How to set file and image upload...
expandshrink

How to set file and image upload restrictions

How to set file and image upload restrictions

Wednesday 18 January 2012 3:30:33 pm - 1 reply

Hello.

I'm working on a filebase where users are able to store images and documents. I don't want the users to store images and files in any file format, allowed image types should be jp(e)g, gif and tiff only. Allowed file formats should be pdf.

Is there a way to set up restrictions like that?

Thanks a lot

Philip

Wednesday 18 January 2012 3:45:42 pm

Hello Philip,

 

Offhand I think you would need to create a modified copy of the ezimagetype and ezbinaryfiletype datatype(s) (renamed say ezimagelimitedtype and ezbinaryfilelimitedtype) and it customize the datatype to provide for the support of say ini based file upload restrictions you require.

I know this is not prefered but it is how eZ Pubish as a system is designed and intended to be used.

 

If you want to affect PHP code changes you often must customize the PHP involved when the features are not already provided by default. In this use case, this would prolly mean a custom datatype(s) to provide for these needs. I hope you can understand.

 

Also in the future if you have time this would make a valuable pull request to merge the functionality you develop to be provided with eZ Publish by default.

 

I hope this helps ...

 

Cheers,
Heath

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu