Fórumok

Remove Image Validation In Structure and Template

Pravin s, módosítva 9 év-val korábban

Remove Image Validation In Structure and Template

New Member Bejegyzések: 10 Csatlakozás dátuma: 2014.12.10. Legújabb bejegyzések
Hi

Based on my need... Upload all kind of document in here... I need to remove the validation......

Can Any one tell me how....
Waiting for reply... I am a new to Liferay....

Mellékletek:

thumbnail
Tanweer Ahmed ., módosítva 1 év-val korábban

RE: Remove Image Validation In Structure and Template

Expert Bejegyzések: 322 Csatlakozás dátuma: 2010.03.11. Legújabb bejegyzések
Hi Pravin,

Default data mapping extensions for image are .gif,.jpeg,.jpg,.png.

You can override this property dynamic.data.mapping.image.extensions in the portal-ext.properties to accept anything.
dynamic.data.mapping.image.extensions=*

Though I would not suggest you to add a * for the value, instead add the other image extensions which you expect will be uploaded.You can add as a comma seaprated value as shown in the default value.

-Tanweer
Pravin s, módosítva 9 év-val korábban

RE: Remove Image Validation In Structure and Template

New Member Bejegyzések: 10 Csatlakozás dátuma: 2014.12.10. Legújabb bejegyzések
Hi Tanweer

Thanks for Your Reply..... emoticon

But it's Not Working.. i've already tried that one....
Need Any other alternative solutions ....

I am using Liferay 6.2-ga2

Waiting for your Response...

-Pravin
thumbnail
Tanweer Ahmed ., módosítva 1 év-val korábban

RE: Remove Image Validation In Structure and Template

Expert Bejegyzések: 322 Csatlakozás dátuma: 2010.03.11. Legújabb bejegyzések
Hi Pravin,

The mentioned property should work.

BTW did you restart the server after configuring the property in portal-ext.properties which is inside of liferay portal home folder.

-Tanweer
thumbnail
Andew Jardine, módosítva 9 év-val korábban

RE: Remove Image Validation In Structure and Template

Liferay Legend Bejegyzések: 2416 Csatlakozás dátuma: 2010.12.22. Legújabb bejegyzések
Tanweer is correct, this is pulled from the portal.properties directly --


    #
    # A file extension of * will permit all file extensions.
    #
    dynamic.data.mapping.image.extensions=.gif,.jpeg,.jpg,.png


Note that the comment is giving the same direction that he did. I just tried in on my side and it worked, so most likely there is something you are not doing correctly.
Another place you can set it is in Control Panel > Server Administration > File Uploads > Web Content Images section. You might want to try there as that setting my be taking priority over the portal-ext setting.

The only other alternative that could be done (though overkill considering there is a property to achieve what you are trying to do) would be to create a struts action hook and override the logic of the Save action to skip the image test. It could be done, but that would mean that the property would no longer have any effect -- could be confusing to future maintainers.