#1 2017-11-20 10:14:38

GauravKumar
Member
Registered: 2017-05-26

Restrict File upload for certain types of files (.jsp, .html)

Hi Team,

Just wanted to know , how to restrict file upload for certain types of files (.jsp,.html) in File System.
If you could help !!.

Offline

#2 2017-11-21 10:37:35

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Restrict File upload for certain types of files (.jsp, .html)

Hi  GauravKumar,

you could use a net.datenwerke.gf.service.upload.hooks.FileUploadHandlerHook and implement the method public String uploadOccured(UploadedFile uploadedFile) in a script.
Either throw an exception if the file is not yet saved, or delete the file if the file is already saved in the file system.
Note that you should not only check the extension, but also the content type of the file.

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB