user2077970
user2077970

Reputation: 11

codeigniter upload PSD file

A am working on a project using codeigniter. Need to upload PSD file. Trying with this code..

$config['allowed_types'] = 'psd';

But the it show as result : The filetype you are attempting to upload is not allowed.

plesae help me.

Upvotes: 1

Views: 692

Answers (3)

saurabh kamble
saurabh kamble

Reputation: 1549

Try to use the following it accepts all files

$config['allowed_types'] = ' * ' ;

Upvotes: 1

Robin Castlin
Robin Castlin

Reputation: 10996

A bit more risky method, but in one way more logical method I use is to allowe all types $config['allowed_types'] = '*'; and simply validate preg_match("\.psd$", $str_file_name) before uploading.

All these mime settings in application/config/mime.php probably exists for a reason, but it's way too overcomplicated with some file types due to silly many different mime types for some cases.

Upvotes: 0

Alex Hermida
Alex Hermida

Reputation: 50

Where are you setting $config['allwoed_types']? In the controller or do you have a config/upload.php?

Also check the psd file that you are trying to upload returns a correct mime type.

Check mime types at application/config/mime.php.

Regards.

Upvotes: 0

Related Questions