Welcome Guest, Not a member yet? Register   Sign In
CI4 validation for file upload accepting any type of file except some extensions
#1

How can I use file upload validation accepting any file type except some extensions, there is no method like is_file or mime_not_in, create a list of all possible mimes I find it long, I would find it easier to accept everything except ... how can I do ?
Reply
#2

(This post was last modified: 04-07-2022, 05:59 AM by ignitedcms.)

That would be very dangerous not recommended. For various file types there should be a simple * opt IIRC, but accepting ANY filetype except a few is not very smart.
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
Reply
#3

(04-07-2022, 05:45 AM)ignitedcms Wrote: That would be very dangerous not recommended. For various file types there should be a simple * opt IIRC, but accepting ANY filetype is not very smart.

In fact I don't want to accept every type of file, but every type, EXCEPT a few
Reply
#4

Your except list would be very long as you definitely don't want to upload php, sql, exe, cmd, vbs, dll, bat, etc....
Reply
#5

(04-07-2022, 06:12 AM)JustJohnQ Wrote: Your except list would be very long as you definitely don't want to upload php, sql, exe, cmd, vbs, dll, bat, etc....

Maybe I had to write: I know the risks with some extensions, and it is for this reason that I would like to upload almost everything (not all), because unfortunately in the real world you do not upload only images, but there are many other types of files that are more than safe and they are certainly many more than unsafe files, at least in my opinion
Reply




Theme © iAndrew 2016 - Forum software by © MyBB