Welcome Guest, Not a member yet? Register   Sign In
Upload Class x Swfupload
#1

[eluser]slith[/eluser]
While trying to use swfupload with the CI Upload class I had 'jpg|jpeg' as valid file types. however i kept getting an error telling me me invalid file type when uploading jpeg images.

I then tried extending the upload class as mention in the forum topic 79115 and 80481 but then i kept getting the invalid path error.

i realized the problem was with is_allowed_filetype() in the Upload class where $this->file_type was recognizing my image as 'application/octet-stream'. i figure this has something to do with how swfupload handles uploads.

so to get around this problem, i simply edited config/mimes.php file and added 'application/octet-stream' to jpg and now it works.

Code:
'jpeg'    =>    array('image/jpeg', 'image/pjpeg', 'application/octet-stream'),
'jpg'    =>    array('image/jpeg', 'image/pjpeg', 'application/octet-stream'),

this may not be the proper way to fix this so if anybody has a better solution please let me know.

Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB