• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
file uploads - exclude file types vs including file types?

#1
[eluser]nikefido[/eluser]
I did a search that came up dry..

I was wondering if anyone has considered (or done) making the allowed file types feature into a "disallowed file types" or "restricted file types"



Naturally this could still be a problem since the system is based on mime-types (so if one items is allowed that is of type octet stream, all items with that mime type is allowed..which is pretty unfortunate...but reversing allowed to disallowed still presents that problem)...

Anyway, has anyone thought of this or done any work towards it?

(more curiosity than a pressing need of mine at this point)

#2
[eluser]Jamie Rumbelow[/eluser]
I'm sure that reversing the process is as easy as putting a "!" infront of whatever checks for filetypes in the Upload class.

Browse through the script, I'm sure you will find something.

#3
[eluser]Xollef[/eluser]
Check out this thread. Might be of help.

#4
[eluser]gstjohn[/eluser]
This post is a bit old, but I figured I would post my solution here in case others came across it. This is an extended version of the existing Upload library in CodeIgniter 1.7.1 to allow you to set the types of files you wish to disallow OR allow depending on your needs. Hope this will be a help to someone.

Modified version of the Upload library to disallow file types


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.