Welcome Guest, Not a member yet? Register   Sign In
Jpeg 2000 Upload
#1

[eluser]christiaan001[/eluser]
Hi There,

I am attempting to upload jpeg 2000 .jp2 & .jpf using the file uploading class.

$config['allowed_types'] ='jpg|jpeg|jp2|jpf';

The above throws the "The filetype you are attempting to upload is not allowed" error.

If anyone has any ideas as to how to allow jp2 & jpf file extensions please let me know.

Many thanks in advanced, :-)
#2

[eluser]umefarooq[/eluser]
yes you can give permission to these extensions just go to applicatio>config>mimes.php file search for jpg file and add there jp2 and jpf but you should know what are mime these extensions.
#3

[eluser]christiaan001[/eluser]
Great!

Thankyou!
#4

[eluser]InsiteFX[/eluser]
application/config/mimes.php
Code:
'jp2'    => 'image/jp2',
'j2k'    => 'image/jp2',

InsiteFX
#5

[eluser]christiaan001[/eluser]
Thanks for the help guys,

I used the following code to in an attempt to find the MIME type for .jp2

$data = array('upload_data' => $this->upload->data());
$mimetype= $data['upload_data']['file_type'];
echo $mimetype;

The result at run time was "application/octet-stream ". This does not seem correct?

So i added 'jp2' => 'application/octet-stream', to mimes.php. and success, I am able to upload .jpg images.

Even though this does work I feel it is not the right way to go about it.

Or is this a case of "if it aint broken dont fix it" :-)

Any guidence appricated,
#6

[eluser]InsiteFX[/eluser]
You also need to check the mime type on your website to
make sure that it is turned on in CPanel or whatever...

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB