Welcome Guest, Not a member yet? Register   Sign In
Disallowed File type is allowed to upload
#1

[eluser]henesnarfel[/eluser]
I'm working with the upload library in 1.7.2. What I'm trying to do is upload a php file. I get the error that

'The filetype you are attempting to upload is not allowed.'

When I look at the $_FILES[]['type'] it has the type as application/octet-stream. In the mimes.php config php has a type of application/x-httpd-php. I know I can add the octet-stream to it and thats fine. I have the allowed file types set to ONLY php. If I change the allowed file types to csv it allows the upload of the php file. This occurs for any file type that has the application/octet-stream mime type in it EX. 'sea,csv,dll,etc...'. There is something within the upload library that is ignoring just looking at the php mimes and allowing it if its in any other mime types in the config. Hopefully you understand whats going on.

UPDATE:

I looked at 1.7.3 and the uploading works correctly other than the mime type not being in the mimes config for the php. So I should be able to add the mime type for php and be ok. Thanks anyway
#2

[eluser]Eric Barnes[/eluser]
Yea many flash based uploaders change the mime type which make it not available to validate against. Because of this CI2 now includes a wildcard option:
Code:
$config['allowed_types'] = '*'
http://ellislab.com/codeigniter/user-gui...ading.html




Theme © iAndrew 2016 - Forum software by © MyBB