Welcome Guest, Not a member yet? Register   Sign In
File upload allowed file types
#1

[eluser]danny123[/eluser]
Not sure if this is a bug as it's easily circumvented by the way you define the allowed file types for the file upload class.

When the file is being validated in CI_Upload::is_allowed_filetype(), it first checks for image types in the array of allowed types. The problem comes in your pipped string of allowed types that you define. If you define some like "jpg|gif|png|zip|txt" and you try to upload a zip file, you'll get an error that the allowed type is not defined, even though it has been defined. The reason this is happening is that the is_allowed_filetype() method iterates through your pipped string, and since it first checks for a valid image, a zip file is clearly not an image.

The simple work around is to just to define all of your non-image files first, then place your image types at the end. The revised definition would look like "zip|txt|jpg|gif|png".

-daniel
#2

[eluser]pistolPete[/eluser]
Has been reported already: http://codeigniter.com/bug_tracker/bug/6780/
#3

[eluser]danny123[/eluser]
Ah, thanks.
#4

[eluser]Unknown[/eluser]
Please check its already reported
#5

[eluser]Zelaza[/eluser]
Yes, thanks very much..... was trying to figure it out




Theme © iAndrew 2016 - Forum software by © MyBB