How to validate/limit upload mime types

Amila Perera Posted in Technical Support 4 years ago

Hi,
I tried uploading various file types when creating a new post and all those were accepted, I need to validate uploads and restrict only for photos. How can I do that ?

Replies
German Michael Zülsdorff Replied 4 years ago

Well,
actually Ossn doesn't upload anything else than images inside of a post.
You just stumbled upon a small logic glitch
as basically a post with just an image IS possible
while an empty post is not.

lk Amila Perera Replied 4 years ago

If somebody can help me on this would be appreciated. What I want to do is.

  • Don't allow users to post any images(or any other files) without
    valid exif data.
  • When they try to I need to throw an error.

Thanks in advance

lk Amila Perera Replied 4 years ago

Please see below. When I select zip file it uploads without any error. But when it's posted its becomes an empty post.
How can I restrict this only to post photos with exif data.

I need to accept only photos with exif data and reject other types of files by throwing an error.
Please help me to customize the code to archive this target
Thanks

enter image description here

enter image description here

German Michael Zülsdorff Replied 4 years ago

Please provide
1. one of these files you were able to upload
2. a screenshot showing that file inside of the post