Foren

Remove Image Validation In Structure and Template

Pravin s, geändert vor 9 Jahren.

Remove Image Validation In Structure and Template

New Member Beiträge: 10 Beitrittsdatum: 10.12.14 Neueste Beiträge
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....
thumbnail
Tanweer Ahmed ., geändert vor 1 Jahr.

RE: Remove Image Validation In Structure and Template

Expert Beiträge: 322 Beitrittsdatum: 11.03.10 Neueste Beiträge
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, geändert vor 9 Jahren.

RE: Remove Image Validation In Structure and Template

New Member Beiträge: 10 Beitrittsdatum: 10.12.14 Neueste Beiträge
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 ., geändert vor 1 Jahr.

RE: Remove Image Validation In Structure and Template

Expert Beiträge: 322 Beitrittsdatum: 11.03.10 Neueste Beiträge
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, geändert vor 9 Jahren.

RE: Remove Image Validation In Structure and Template

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
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.