Welcome Guest, Not a member yet? Register   Sign In
How to upload all file types (disable 'allowed_types')
#1

[eluser]himalking[/eluser]
hello everybody,

I need help uploading all file types
I want the upload class to upload any file type some thing like this
$config['allowed_types'] = '*';

I don't wanna list all and every file type
#2

[eluser]Madmartigan1[/eluser]
If you're using CI 2.0, you can use "*" to allow all types.

If you aren't you could read the keys of the mimetypes in your config/mimetypes.php and implode('|', $the_array_keys)
#3

[eluser]himalking[/eluser]
[quote author="Madmartigan1" date="1292424785"]If you're using CI 2.0, you can use "*" to allow all types.

If you aren't you could read the keys of the mimetypes in your config/mimetypes.php and implode('|', $the_array_keys)[/quote]

what is CI 2.0, do you mean v 2.0 !!
the current version is 1.7.2.

any way I have tweaked the current codeigniter Upload.php library to allow the "*" to upload all file types, here it is if someone is interested:

1- in "system/libraries/Upload.php" search for
Code:
function is_allowed_filetype($ignore_mime = FALSE){

2- add the following code at the beginning of the function
Code:
if($this->allowed_types[0] == '*')
{
return true;
}

I know it's not right to edit the core file system, so can someone advice me how to implement this without modding the file system.

some might say be extending the upload.php, but actually I don't know how to make it




Theme © iAndrew 2016 - Forum software by © MyBB